状态='1',其中id位于(“.inplade(',',$arrayIDs)。”); $db=$this->getDBO(); $db->setQuery($query); 如果(!$db->query()){ $errorMessage=$this->getDBO()->getErrorMsg(); JError::raiseError(500,“错误发布事件:”.$errorMessage); } } 函数unpublishEvents($arrayIDs) { $query=“更新#uu事件集状态='0',其中id位于(“.inplade(',',$arrayIDs)。”); $db=$this->getDBO(); $db->setQuery($query); 如果(!$db->query()){ $errorMessage=$this->getDBO()->getErrorMsg(); JError::raiseError(500,“错误发布事件:”.$errorMessage); } } } view.html.php jimport('joomla.application.component.view'); 类eventsViewEvents扩展了JViewLegacy{ 受保护的类别; 受保护的物品; 受保护的$分页; 受保护的国家; 函数显示($tpl=null) { $this->categories=$this->get('CategoryOrders'); $this->state=$this->get('state'); $this->addToolBar(); //从模型中获取数据 $events=$this->get('Data'); $pagination=$this->get('pagination'); //将数据推送到模板中 $this->events=$events; $this->assignRef($pagination',$pagination); 父::显示($tpl); } 函数添加($tpl=null){ $this->addToolBar(); 父::显示($tpl); } 受保护的函数addToolbar() { 需要一个JPATH组件。“/helpers/events.php”; $canDo=EventsHelper::getActions($this->state->get('filter.category_id'); $user=JFactory::getUser(); JToolBarHelper::title('eventmanager','generic.png'); JToolBarHelper::addNew('add'); 如果(计数($user->getAuthorizedCategories('com_事件','core.create'))>0) { //JToolBarHelper::addNew('add'); } 如果($canDo->get('core.edit')) { JToolBarHelper::editList('edit'); } if($canDo->get('core.edit.state')) { 如果($this->state->get('filter.state')!=2) { JToolBarHelper::divider(); JToolBarHelper::publish('publish','JTOOLBAR_publish',true); JToolBarHelper::unpublish('unpublish','JTOOLBAR_unpublish',true); } } 如果($this->state->get('filter.state')==-2&&$canDo->get('core.delete')) { JToolBarHelper::deleteList(“”,'remove','JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } elseif($canDo->get('core.edit.state')) { JToolBarHelper::垃圾(“删除”); JToolBarHelper::divider(); } } 函数displayEdit($eventId,$tpl=NULL) { JToolBarHelper::title('Event'.:[Edit]'); JToolBarHelper::save(); JToolBarHelper::cancel(); $model=$this->getModel(); $event=$model->getEvent($eventId); $this->event=$event; 父::显示($tpl); } 函数displayAdd($tpl=NULL){ JToolBarHelper::title('事件':[Add]'); JToolBarHelper::save(); JToolBarHelper::cancel(); 父::显示($tpl); } } default.php

状态='1',其中id位于(“.inplade(',',$arrayIDs)。”); $db=$this->getDBO(); $db->setQuery($query); 如果(!$db->query()){ $errorMessage=$this->getDBO()->getErrorMsg(); JError::raiseError(500,“错误发布事件:”.$errorMessage); } } 函数unpublishEvents($arrayIDs) { $query=“更新#uu事件集状态='0',其中id位于(“.inplade(',',$arrayIDs)。”); $db=$this->getDBO(); $db->setQuery($query); 如果(!$db->query()){ $errorMessage=$this->getDBO()->getErrorMsg(); JError::raiseError(500,“错误发布事件:”.$errorMessage); } } } view.html.php jimport('joomla.application.component.view'); 类eventsViewEvents扩展了JViewLegacy{ 受保护的类别; 受保护的物品; 受保护的$分页; 受保护的国家; 函数显示($tpl=null) { $this->categories=$this->get('CategoryOrders'); $this->state=$this->get('state'); $this->addToolBar(); //从模型中获取数据 $events=$this->get('Data'); $pagination=$this->get('pagination'); //将数据推送到模板中 $this->events=$events; $this->assignRef($pagination',$pagination); 父::显示($tpl); } 函数添加($tpl=null){ $this->addToolBar(); 父::显示($tpl); } 受保护的函数addToolbar() { 需要一个JPATH组件。“/helpers/events.php”; $canDo=EventsHelper::getActions($this->state->get('filter.category_id'); $user=JFactory::getUser(); JToolBarHelper::title('eventmanager','generic.png'); JToolBarHelper::addNew('add'); 如果(计数($user->getAuthorizedCategories('com_事件','core.create'))>0) { //JToolBarHelper::addNew('add'); } 如果($canDo->get('core.edit')) { JToolBarHelper::editList('edit'); } if($canDo->get('core.edit.state')) { 如果($this->state->get('filter.state')!=2) { JToolBarHelper::divider(); JToolBarHelper::publish('publish','JTOOLBAR_publish',true); JToolBarHelper::unpublish('unpublish','JTOOLBAR_unpublish',true); } } 如果($this->state->get('filter.state')==-2&&$canDo->get('core.delete')) { JToolBarHelper::deleteList(“”,'remove','JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } elseif($canDo->get('core.edit.state')) { JToolBarHelper::垃圾(“删除”); JToolBarHelper::divider(); } } 函数displayEdit($eventId,$tpl=NULL) { JToolBarHelper::title('Event'.:[Edit]'); JToolBarHelper::save(); JToolBarHelper::cancel(); $model=$this->getModel(); $event=$model->getEvent($eventId); $this->event=$event; 父::显示($tpl); } 函数displayAdd($tpl=NULL){ JToolBarHelper::title('事件':[Add]'); JToolBarHelper::save(); JToolBarHelper::cancel(); 父::显示($tpl); } } default.php,php,pagination,joomla3.0,joomla-component,Php,Pagination,Joomla3.0,Joomla Component,有谁能帮我找出什么问题或我缺少什么扩展类JModelList而不是JModelLegacy,这应该会让我感到抱歉。这可能是因为所需的Javascript框架不可用。如果是这种情况,可以检查Javascript控制台 如果是这种情况,在您的视图中,在行之前扩展JViewLegacy: $this->pagination = $this->get('Pagination'); 在下一行插入: JHtml::_('behavior.framework'); 另外,确保模板没有删除所需的

有谁能帮我找出什么问题或我缺少什么

扩展类JModelList而不是JModelLegacy,这应该会让我感到抱歉。

这可能是因为所需的Javascript框架不可用。如果是这种情况,可以检查Javascript控制台

如果是这种情况,在您的视图中,在行之前扩展
JViewLegacy

$this->pagination = $this->get('Pagination');
在下一行插入:

JHtml::_('behavior.framework');
另外,确保模板没有删除所需的框架

unset($doc->_scripts[JURI::root(true) . '/media/system/js/core.js']);
如果在模板
index.php


希望这有帮助:)

我也尝试了JModelList,但没有任何更改。相同的问题是从模型类中删除方法getPagination()。您正在重写,因此通过重写getPagination()可以使核心分页功能为您完成的所有工作无效方法。您还需要将_buildQuery()方法重命名为getListQuery(),以确保父类可以访问要分页的原始数据。我已删除了getPagination()并将_buildQuery()重命名为getListQuery(),但仍然无效。相同的空白页,但在删除“u构造()时)“一切正常,但没有分页。哇..我刚看到问题的日期..嗯..希望它能帮助其他人..”。。
unset($doc->_scripts[JURI::root(true) . '/media/system/js/core.js']);