Php Joomla 3.5子控制器/类
我在joomla 3.5中遇到问题,无法在分包商中找到任务。我在跑J!转储,可以看到它正在运行分包商的构造函数,但是Php Joomla 3.5子控制器/类,php,joomla,Php,Joomla,我在joomla 3.5中遇到问题,无法在分包商中找到任务。我在跑J!转储,可以看到它正在运行分包商的构造函数,但是/administrator/index.php?option=com\u mycomponent&task=subctrl.trask返回task[trask]not found我尝试在构造函数中使用$this->registerTask('trask',trask')。。。你知道我做错了什么吗 /管理员/components/com_mycomponent/controller
/administrator/index.php?option=com\u mycomponent&task=subctrl.trask
返回task[trask]not found
我尝试在构造函数中使用$this->registerTask('trask',trask')
。。。你知道我做错了什么吗
/管理员/components/com_mycomponent/controllers/subctrl.php
以下是callstack中引用的管理部分mycomponent.php
文件(为了清晰起见,删除了一些注释行):
我认为您无法从JControllerAdmin
进行扩展。您应该从jcontrolleregacy
或jcontrolleregacy
进行扩展
<?php
defined('_JEXEC') or die ;
class MycomponentControllerSubctrl extends JControllerAdmin
{
function __construct()
{
$this->registerTask('trask', 'trask');
dumpMessage('running controller');
dump($this, 'Ctrler');
}
public function trask()
{
dumpMessage('running Ctrl Trask');
return true;
}
}
# Function Location
1 JApplicationCms->execute() /Users/evanion/Projects/php/joomla/administrator/index.php:51
2 JApplicationAdministrator->doExecute() /Users/evanion/Projects/php/joomla/libraries/cms/application/cms.php:257
3 JApplicationAdministrator->dispatch() /Users/evanion/Projects/php/joomla/libraries/cms/application/administrator.php:152
4 JComponentHelper::renderComponent() /Users/evanion/Projects/php/joomla/libraries/cms/application/administrator.php:98
5 JComponentHelper::executeComponent() /Users/evanion/Projects/php/joomla/libraries/cms/component/helper.php:380
6 require_once() /Users/evanion/Projects/php/joomla/libraries/cms/component/helper.php:405
7 JControllerLegacy->execute() /Users/evanion/Projects/php/joomla/administrator/components/com_mycomponent/mycomponent.php:17
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Get an instance of the controller prefixed by HelloWorld
$controller = JControllerLegacy::getInstance('Mycomponent');
// Perform the Request task
$controller->execute(JFactory::getApplication()->input->get('task'));
// Redirect if set by the controller
$controller->redirect();