我正在尝试从这里开发组件。我在管理部分遇到错误
500 - 发生错误。
无效的控制器:名称='',格式=''
如何调试这个?我什至不知道与发布相关的代码。
文件:admin/controller.php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
class TestimonialsController extends JController {
function display($cachable = false) {
// set default view if not set
JRequest::setVar('view', JRequest::getCmd('view', 'Testimonials'));
// call parent behavior
parent::display($cachable);
}
}
文件:admin/testimonials.php
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.controller');
$controller = JController::getInstance('Testimonials');
$controller->execute(JRequest::getCmd('task'));
$controller->redirect();
文件:admin/views/testimonials/view.html.php
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
class TestimonialsViewTestimonials extends JView {
function display($tpl = null) {
$items = $this -> get("Items");
$pagination = $this -> get("Pagination");
//Check for errors
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Assign data to the view
$this -> items = $items;
$this -> pagination = $pagination;
// Display the template
parent::display($tpl);
}
}