Controller can't find the view in Yii

拈花ヽ惹草 提交于 2020-01-05 07:33:31

问题


I want a view from another module to be rendered and I use path '//modulename/foldername/viewname'(without .php), but when I run it I get "Controller can't find the view" error. What do I do wrong? It used to work before. My version of Yii is 1.1.15.

EDIT: These is my urlManager:

'urlManager'    => array(
            'class'          => 'yupe\components\urlManager\LangUrlManager',
            'languageInPath' => true,
            'langParam'      => 'language',
            'urlFormat'      => 'path',
            'showScriptName' => false,
            'cacheID'        => 'cache',
            'rules'          => array(
)

But how can it be related to my problem? Doesn't urlManager has nothing to do with view aliases?


回答1:


give it the full path to that file:

$this->render('application.modules.modulename.foldername.viewname' , $arrayData);


来源:https://stackoverflow.com/questions/25112374/controller-cant-find-the-view-in-yii

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!