1
如何在一個模塊的控制器使Yii中如何呈現指數,而不是application.modules.modulename.views.modulename.index
$this->render('index');
代替
$this->render('application.modules.modulename.views.modulename.index');
?試圖用谷歌搜索和
$this->setbasePath('application.modules.modulename')
在ModulenameModule但無濟於事。有任何想法嗎?
應該默認啓用。你用gii生成了你的模塊嗎? – 2012-07-22 14:16:28
是的,它是用gii生成的。 – 2012-07-22 14:36:26
所以我想如果你使用渲染('索引'),你會'找不到請求的視圖'索引'錯誤?你有沒有使用getBasePath()檢查模塊basePath?因爲你不知道你可以在你的視圖中執行'$ this-> module-> getBasePath();'確認 – 2012-07-22 15:01:46