Yii2 theme integration

前端 未结 6 1738
囚心锁ツ
囚心锁ツ 2020-12-01 10:10

I have installed Yii2 advanced application, and now I want to change backend theme. How can I do this? Is there any file where I need to tell Yii2 that use my custom theme?

6条回答
  •  北海茫月
    2020-12-01 10:12

    Create a view folder in your themes/mytheme and move all view files like main.php into it and other layouts needed.

    Also you can set your basic layout in the backend\config\main.php like

    return [
    'id' => 'app-backend',
    'layout'=>'yourtheme', //your `themes/mytheme/views/` contain yourtheme.php in this case
    ...
    

    Also change pathmap to

     'pathMap' => ['@app/views' => '@app/themes/mytheme/views'],
    

提交回复
热议问题