博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Yii ServiceLocator.php
阅读量:7003 次
发布时间:2019-06-27

本文共 1266 字,大约阅读时间需要 4 分钟。

  public function getComponents($returnDefinitions = true)    {        return $returnDefinitions ? $this->_definitions : $this->_components;    }    /**     * Registers a set of component definitions in this locator.     *     * This is the bulk version of [[set()]]. The parameter should be an array     * whose keys are component IDs and values the corresponding component definitions.     *     * For more details on how to specify component IDs and definitions, please refer to [[set()]].     *     * If a component definition with the same ID already exists, it will be overwritten.     *     * The following is an example for registering two component definitions:     *     * ```php     * [     *     'db' => [     *         'class' => 'yii\db\Connection',     *         'dsn' => 'sqlite:path/to/file.db',     *     ],     *     'cache' => [     *         'class' => 'yii\caching\DbCache',     *         'db' => 'db',     *     ],     * ]     * ```     *     * @param array $components component definitions or instances     */    public function setComponents($components)    {        foreach ($components as $id => $component) {            $this->set($id, $component);        }    }

配置文件中的componets数组都到了这里

转载于:https://www.cnblogs.com/a-flydog/p/6782241.html

你可能感兴趣的文章
浅谈C/C++中的typedef和#define
查看>>
浅谈C/C++中的指针和数组(一)
查看>>
这该死的数字化生活
查看>>
matlab练习程序(圆柱投影)
查看>>
需要谨记的产品设计原则
查看>>
checkbox实现单选多选
查看>>
billing是如何的拆分的?
查看>>
Lua 迭代器与closure
查看>>
mybatis_helloworld(2)_源码
查看>>
完整部署CentOS7.2+OpenStack+kvm 云平台环境(3)--为虚拟机指定固定ip
查看>>
BLE 广播数据解析
查看>>
Oracle用户密码过期和用户被锁解决方法【转】
查看>>
Android 解决Android的TextView和EditText换行问题
查看>>
CSS效果集锦(持续更新中)
查看>>
通过重建Hosting系统理解HTTP请求在ASP.NET Core管道中的处理流程[中]:管道如何处理请求...
查看>>
Eigen教程(9)
查看>>
单元测试
查看>>
操作hadoop的经验积累
查看>>
微信企业号验证
查看>>
请问set JAVA_OPTS的各项參数是什么意思?
查看>>