【发布时间】:2014-06-18 17:05:48
【问题描述】:
我根据http://docs.joomla.org/ 的教程学习开发组件,我在分页时遇到问题,单击第 1、2、3 页...不起作用,
这是我的代码: com_bet/models/test.php:
defined('_JEXEC') or die;
jimport('joomla.application.component.modellist');
class BetModelTest extends JModelList{
protected function getListQuery(){
$db=JFactory::getDbo();
$query=$db->getQuery(true);
$query->select('*')->from('#__member');
return $query;
}
}
com_bet/views/test/view.html.php
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
class BetViewTest extends JViewLegacy{
function display($tpl=null){
$items=$this->get('Items');
$pagination=$this->get('Pagination');
$this->items=$items;
$this->pagination=$pagination;
parent::display($tpl);
}
}
com_bet/views/test/tmpl/default.php:
defined('_JEXEC') or die;
JHtml::_('behavior.tooltip');
?>
<form action="index.php?option=com_bet&view=test" method="post">
<table>
<thead>
<tr>
<th>ID</th>
<th>Username</th>
<th>Password</th>
<th>Funds</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $item){?>
<tr>
<td><?php echo $item->id;?></td>
<td><?php echo $item->username;?></td>
<td><?php echo $item->pass;?></td>
<td><?php echo $item->funds;?></td>
</tr>
<?php }?>
</tbody>
<tfoot>
<tr>
<td colspan='4'><?php echo $this->pagination->getListFooter();?></td>
</tr>
<tfoot>
</table>
</form>
我在 chrome 检查元素中观看,它显示“无法读取未定义的属性 'limitstart'”,如后面的图片: http://i1119.photobucket.com/albums/k623/helbros/joomla.png
帮帮我,非常感谢
【问题讨论】:
标签: joomla pagination