2019-12-05 20:40:53 957次浏览 0条回答 0 悬赏 20 金钱

文档中是这么写的:

如果 init() 方法包含很多初始化模块属性代码, 可将他们保存在配置 并在 init() 中使用以下代码加载:

public function init()
{
    parent::init();
    // 从config.php 加载配置来初始化模块
    \Yii::configure($this, require __DIR__ . '/config.php');
}

config.php 配置文件可能包含以下内容,类似 应用主体配置。

<?php
return [
    'components' => [
        // list of component configurations
    ],
    'params' => [
        // list of parameters
    ],
];

这个无法生效啊,求大腿告知正确姿势~~

    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
mydzoo
总监

mydzoo

注册时间:2017-01-05
最后登录:2022-03-29
在线时长:53小时40分
  • 粉丝4
  • 金钱2075
  • 威望10
  • 积分2705

热门问题