yii框架学习笔记三
生活随笔
收集整理的這篇文章主要介紹了
yii框架学习笔记三
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
運行config的時候,如果cwebapplication定義有public的屬性,比如basePath,則不用調(diào)用魔術(shù)函數(shù)__set
application=》run
processrequest
||
runController
|| || ||
createController $controller->init(); $controller->run($actionID);
||
framework/web/CController的run =》runActionWithFilters
組件是先注冊,待需要用到時候在新建,初始化;比如loginForm.php中的login()
Yii::app()->user會調(diào)用cwebapplication的getUser,返回組件return $this->getComponent('user');
如果$this->_components已經(jīng)存在'user',直接返回,否則在注冊的_componentConfig中查找,找到后創(chuàng)建,并且初始化
application=》run
processrequest
||
runController
|| || ||
createController $controller->init(); $controller->run($actionID);
||
framework/web/CController的run =》runActionWithFilters
組件是先注冊,待需要用到時候在新建,初始化;比如loginForm.php中的login()
Yii::app()->user會調(diào)用cwebapplication的getUser,返回組件return $this->getComponent('user');
如果$this->_components已經(jīng)存在'user',直接返回,否則在注冊的_componentConfig中查找,找到后創(chuàng)建,并且初始化
轉(zhuǎn)載于:https://www.cnblogs.com/codelifezj/archive/2011/06/29/2093679.html
總結(jié)
以上是生活随笔為你收集整理的yii框架学习笔记三的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在 C# 中,new 关键字可用作运算符
- 下一篇: base target=_self/IE