【发布时间】:2013-01-19 18:07:55
【问题描述】:
很多人都知道 Joomla 2.5 中的控制器从
// Create the controller
$classname = 'mycomponentController'.$controller;
$controller = new $classname( );
// Perform the Request task
$controller->execute( JRequest::getVar('task'));
// Redirect if set by the controller
$controller->redirect();
类似于
// Get an instance of the controller prefixed by the component
$controller = JController::getInstance('mycomponent');
// Perform the Request task
$controller->execute(JRequest::getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
现在在 Joomla 1.5 中以及通过使用表格,您可以通过运行链接来运行任务
index.php?option=com_mycomponent&controller=specificcontroller&task=randomtask
但是这种链接样式不适用于新控制器 - 如果您使用新控制器,有人知道如何在 Joomla 2.5 中格式化此链接吗?
【问题讨论】: