2016-06-22 16 views
-1

joomla 3.5で問題が発生していますが、サブコントローラでタスクが見つからない。私はJ!Dumpを実行していて、サブコントローラーのコンストラクターを実行していることがわかりますが、/administrator/index.php?option=com_mycomponent&task=subctrl.trasktask [trask] not foundを返します。$this->registerTask('trask', 'trask')をコンストラクターで使用しようとしましたが、Joomla 3.5サブコントローラ/クラス

<?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; 
    } 
} 

/administrator/components/com_mycomponent/controllers/subctrl.php

私は、次のコールスタックを取得する:ここで

# 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 

はで参照、管理セクションmycomponent.phpファイルですコールスタック(明確にするためにいくつかのコメント行を削除):

<?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(); 

コントローラディレクトリは、管理フォルダのxmlメタデータに指定されています。

答えて

0

私はあなたの目的のためにJControllerAdminから延期することはできないと思います。 JControllerFormまたはJControllerLegacyから拡張する必要があります。

関連する問題