<AR> CActiveRecord:path:/framework/db/ar/CActiveRecord.phpoverview:is the base class for classes representing relational data.It implements the active record design pattern, a popular Object-Relational Mapping (ORM) technique. 实现原理:首先一套__sleep(),__g…
ServiceLocator,服务定位类,用于yii2中的依赖注入,通过以ID为索引的方式缓存服务或则组件的实例来定位服务或者组件: namespace yii\di; use Yii; use Closure; use yii\base\Component; use yii\base\InvalidConfigException; /** * ServiceLocator implements a [service locator](http://en.wikipedia.org/wiki/S…
今天开始阅读yii2的源码,想深入了解一下yii框架的工作原理,同时学习一下优秀的编码规范和风格.在此记录一下阅读中的小心得. 每个框架都有一个入口文件,首先从入口文件开始,yii2的入口文件位于web目录的index.php,用于启动web应用和配置一些路径参数. index.php—— // comment out the following two lines when deployed to production defined('YII_DEBUG') or define('YII_D…
CComponent: path:framework/base/CComponent.php overview:This file contains the foundation classes for component-based and event-driven programming. (包含基于组件和事件驱动编程的基础类,是所有components的基类) 1.property定义 $a=$component->text; // equivalent to $…