【问题标题】:Error in Specifying Layout in Joomla component在 Joomla 组件中指定布局时出错
【发布时间】:2011-10-09 08:55:11
【问题描述】:

我一直在开发一个组件。现在我在组件中有一个表单

即提交到 index.php?option=com_mycomponent&task=myTask。现在在控制器中

我有 myTask() 函数,我正在像这样指定视图和布局

    $model = $this->getModel('mymodel');

    $view =& $this->getView('myview');

    $view->setModel($model, true );

    $view->displayReports();

我在view.html.php中有displayReports()函数,是这样的

function displayReports($tpl = null){

    global $mainframe;

    $this->_layout = 'viewcjreport';

    $reports= & $this->get('Reports');

    $this->assignRef('reports',$reports);

    parent::display($tpl);

}

但是当我提交表单时,我收到错误“未找到视图 [名称、类型、前缀]: cjunction,,kingdomView'。

请让我知道这里有什么问题以及如何指定 正确查看。这将是一个很大的帮助。

【问题讨论】:

    标签: joomla joomla1.5 joomla-extensions


    【解决方案1】:

    从记忆中完成这项工作,您需要创建

    class kingdomView_cjunction extends JView{
    }
    

    在组件/视图/cjunction/view.html.php中

    【讨论】:

      猜你喜欢
      • 2013-04-08
      • 2015-04-04
      • 2012-12-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-11
      • 2012-12-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多