在 Joomla 组件中指定布局时出错
我一直致力于组件的开发。现在我在组件中有一个表单
正在提交到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);
}
但是当我提交表单时我收到错误as '未找到视图 [名称、类型、前缀]: cjunction,,kingdomView'。
请让我知道这里有什么问题以及如何指定 正确查看。这将是一个很大的帮助。
I have been working with the development of a component. Now I have a form in the component
that is submitting to a index.php?option=com_mycomponent&task=myTask. Now in the controller
I have the function myTask() and I am specifying the view and layout like this
$model = $this->getModel('mymodel');
$view =& $this->getView('myview');
$view->setModel($model, true );
$view->displayReports();
I have the displayReports() function in the view.html.php and it is like this
function displayReports($tpl = null){
global $mainframe;
$this->_layout = 'viewcjreport';
$reports= & $this->get('Reports');
$this->assignRef('reports',$reports);
parent::display($tpl);
}
But when I submit the form I am getting error as 'View not found [name, type, prefix]:
cjunction,,kingdomView'.
Please let me know what is the issue here and how can I specify the
view correctly. It will be a great help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据记忆,要完成这项工作,您需要
在 Components/views/cjunction/view.html.php 中创建
From memory to make this work you need to create
in components/views/cjunction/view.html.php