Authentication yii身份验证集主题

Authentication yii身份验证集主题,authentication,layout,module,yii,themes,Authentication,Layout,Module,Yii,Themes,我想在我的布局中使用yii auth模块。但在这种布局中,我有 <?php echo Yii::app()->theme->baseUrl; ?> 因为我需要加载一些css文件和图像。模块yii auth没有设置主题,所以我得到了错误,因为没有设置主题“panel” Yii auth设置允许我只设置布局,而不设置主题 我可以通过修改yii auth模块来轻松设置,但是在yii auth更新时我必须记住这一点。它很脏:) 问题是:我如何在不切换模块/auth文件夹的情

我想在我的布局中使用yii auth模块。但在这种布局中,我有

<?php echo Yii::app()->theme->baseUrl; ?>

因为我需要加载一些css文件和图像。模块yii auth没有设置主题,所以我得到了错误,因为没有设置主题“panel”

Yii auth设置允许我只设置布局,而不设置主题

我可以通过修改yii auth模块来轻松设置,但是在yii auth更新时我必须记住这一点。它很脏:)

问题是:我如何在不切换模块/auth文件夹的情况下更改yii auth的主题

编辑:
我的默认配置不是“面板”。我无法在config/main.php中设置'theme'=>'panel'。

因为您可以为模块定义自定义布局,您可以这样做(例如,文件
视图/layouts/panel.php
):


这将设置另一个主题,然后只使用主布局文件。 在配置中,您应该将
//layouts/panel
设置为auth模块的默认布局

您还可以根据每个文件/视图执行此操作,请参阅以获取示例实现

[更新]

请看一看 您可以为每个控制器路由定义一个主题。

在我的案例设置中

    'appLayout' => 'webroot.themes.bootstrap.views.layouts.main', // the layout used by bootstrap theme.
在/config/main.php中实现了这一点

 'auth' => array(
            'strictMode' => true, // when enabled authorization items cannot be assigned children of the same type.
            'userClass' => 'User', // the name of the user model class.
            'userIdColumn' => 'id', // the name of the user id column.
            'userNameColumn' => 'username', // the name of the user name column.
            'defaultLayout' => 'application.views.layouts.main', // the layout used by the module.
            'appLayout' => 'webroot.themes.bootstrap.views.layouts.main', // the layout used by bootstrap theme.
            'viewDir' => null, // the path to view files to use with this module.
        ),
 'auth' => array(
            'strictMode' => true, // when enabled authorization items cannot be assigned children of the same type.
            'userClass' => 'User', // the name of the user model class.
            'userIdColumn' => 'id', // the name of the user id column.
            'userNameColumn' => 'username', // the name of the user name column.
            'defaultLayout' => 'application.views.layouts.main', // the layout used by the module.
            'appLayout' => 'webroot.themes.bootstrap.views.layouts.main', // the layout used by bootstrap theme.
            'viewDir' => null, // the path to view files to use with this module.
        ),