モジュールで作業レイアウトを取得しようとしています。そこで、 「adminLayout」というモジュールのビューフォルダーにレイアウトを作成しました
AdminModule.php
init() メソッドでレイアウトを想定しています。したがって、次のようになります。
public function init()
{
$this->layoutPath = Yii::getPathOfAlias('application.modules.admin.views.layouts');
$this->layout = 'adminLayout';
// this method is called when the module is being created
// you may place code here to customize the module or the application
// import the module-level models and components
$this->setImport(array(
'admin.models.*',
'admin.components.*',
));
}
しかし、何らかの理由でレイアウトがモジュールに適用されませんでした。「public $layout」をコントローラーに追加しようとしましたが、機能します。
何が問題なのかわかりません。
また、構成フォルダーにレイアウト設定を追加しようとしましmain.php
たが、まだアクションはありません。誰かが助けてくれれば感謝します。