Joomla 3.9 组件视图控制器未触发 为什么?

问题描述

当给定任务=>“取消”时,我试图重新路由到另一个视图,但我的视图控制器甚至没有触发。有什么想法吗?

/components/com_mycomp/mycomp.PHP:

$controller = JControllerLegacy::getInstance('Mycomp');

$input = JFactory::getApplication()->input; $controller->execute($input->getCmd('task'));

$controller->redirect();

/components/com_mycomp/controller.PHP

类 MycompController 扩展了 JControllerLegacy {

protected $default_view = 'dashboard';

function __construct()
{
    parent::__construct();
}

}

/components/com_mycomp/contollers/myview.PHP

jimport('joomla.application.component.controller');

类 MycompControllerMyview 扩展了 JControllerLegacy {

function __construct()
{
    parent::__construct();
    $model = $this->getModel();
}

function display()
{
    parent::display();
}

public function getModel($name = 'Myview',$prefix = 'MycompModel',$config = array('ignore_request' => true))
{
    $model = parent::getModel($name,$prefix,$config);

    return $model;
}

function cancel() {
    $jinput = JFactory::getApplication()->input;
    $jinput->set('view','MyOtherView');

    parent::display();
}

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)