读Yii框架源码

来源:互联网 发布:图形界面编程工具 编辑:程序博客网 时间:2024/05/18 02:52

最近需要用Yii框架,今天自己粗略地看了部分源码,写出来看看,如果有朋友进来看了,实在对不起,没有排版,逻辑也混乱,估计只有我自己能看懂(以后一定好好写博客...要走的路还很远啊)

index.php加载类Yii,Yii继承YiiBase,创建CWebApplication,继承自CApplication(CModel<-CComponent),run()中onBeginRequest()raiseEvent()onBeginRequest事件
CWebApplication init(),getRequest()(继承自CApplication),其中getComponent()(继承自CModel)使用组件request,解析url,获取到$route,runController(),其中调用createController()创建类实例,createController()中调用parseAction()解析成action和参数,保存$oldController,运行$controller



原创粉丝点击