zoukankan      html  css  js  c++  java
  • Yii ServiceLocator.php

      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' => 'yiidbConnection',
         *         'dsn' => 'sqlite:path/to/file.db',
         *     ],
         *     'cache' => [
         *         'class' => 'yiicachingDbCache',
         *         'db' => 'db',
         *     ],
         * ]
         * ```
         *
         * @param array $components component definitions or instances
         */
        public function setComponents($components)
        {
            foreach ($components as $id => $component) {
                $this->set($id, $component);
            }
        }

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

  • 相关阅读:
    3.30 DOM操作
    3.29 js例题
    3.28 函数
    3.27 数组例题
    Web 条件查询、分页查
    web页面增、删、改
    JDBC事务、下拉框
    JSTL、断点、JavaEE、DBUTils连接池
    jsp、el表达式
    Session技术 、jsp页面
  • 原文地址:https://www.cnblogs.com/a-flydog/p/6782241.html
Copyright © 2011-2022 走看看