众所周知,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 中格式化此链接?