【发布时间】:2015-09-10 13:04:07
【问题描述】:
我收到如下错误:
注意:未定义的属性:CedTagViewTag::$pagination
和
致命错误:调用成员函数 get()
这是我收到错误的代码部分:
(($this->show_pagination == 1 || ($this->show_pagination == 2)) && ($this->pagination->get('pages.total') > 1)) { ?>
<div class="pagination">
我该如何解决? 这是完整的代码
defined('_JEXEC') or die('Restricted access');
require_once (JPATH_SITE . '/components/com_content/helpers/route.php');
require_once JPATH_SITE . '/components/com_cedtag/helpers/themes.php';
// to reuse components/com_content/views/category/tmpl/blog_item.php
// when doing later $this->loadTemplate('item');
$this->addTemplatePath(JPATH_SITE . '/components/com_content/views /category/tmpl');
JHtml::addIncludePath(JPATH_SITE . '/components/com_cedtag/helpers');
//blog_item.php use icon.php
JHtml::addIncludePath(JPATH_SITE . '/components/com_content/helpers');
$document = JFactory::getDocument();
$document->addStyleSheet('media/com_cedtag/css/blog.css');
$cedTagsHelper = new CedTagsHelper();
if ($this->tagDescription) {
$document->setDescription($cedTagsHelper->truncate($this->tagDescription));
} else {
$document->setDescription($cedTagsHelper->truncate($this->tag));
}
$document->setTitle($this->title);
$document->setMetadata('keywords', $this->tag);
$CedTagThemes = new CedTagThemes();
$CedTagThemes->addCss();
?>
<h1><?php echo JText::_('COM_CEDTAG_POSTS_TAGGED') . " " . JText::_('\'') . $this->tag . JText::_('\'') ?></h1>
<?php if (isset($this->showDescription) && $this->showDescription && ($this->tagDescription != null)) { ?>
<div class="category-desc">
<?php echo $this->tagDescription; ?>
</div>
<?php
}
?>
<?php if (isset($this->ads_top_use) && $this->ads_top_use) { ?>
<div class="cedTagAdsTopContent">
<?php echo $this->ads_top_content; ?>
</div>
<?php } ?>
<?php
if (isset($this->results) && !empty($this->results)) {
foreach ($this->results as $item) {
$this->item = & $item;
echo $this->loadTemplate('item');
}
} ?>
<?php
if (isset($this->ads_bottom_use) && $this->ads_bottom_use) {
?>
<div class="cedTagAdsBottomContent">
<?php echo $this->ads_bottom_content; ?>
</div>
<?php
}
?>
<?php if (($this->show_pagination == 1 || ($this->show_pagination == 2)) && ($this->pagination->get('pages.total') > 1)) { ?>
<div class="pagination">
<?php if ($this->show_pagination_results) { ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php } ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php } ?>
【问题讨论】:
-
那里有什么框架吗??
-
$pagination 是如何声明的以及在哪里声明的?