0
如何将我的joomla组件布局重定向到自定义布局。我一直试图通过几种方式来实现这一点,但似乎并不奏效。我有我的控制器joomla布局,如何更改主题?
class FrontpageController extends JController {
protected $id;
protected $input;
function __construct($config = array()) {
$this->input = JFactory::getApplication()->input;
parent::__construct($config);
}
public function display($cachable = false, $urlparams = array()) {
// Initialise variables.
$this->input = JFactory::getApplication()->input;
$cachable = true;
// Set the default view name and format from the Request.
$viewName = $this->input->get('view', 'frontpage');
$this->input->set('view', $viewName);
return parent::display($cachable, $safeurlparams);
}
public function getItem() {
// Initialise variables.
$item = $this->getModel('item');
$this->input->set('view','item');
if (!item) {
JLog::add(implode('<br />', $errors), JLog::WARNING, 'jerror');
return false;
return $item;
}
}
}
比以下网址index.php?option=com_mycomponent&task=getItem&layout=item&id=2571
应该调用控制器的getItem方法和输出称为item