基于Phalcon框架1.3版本开发,继承优化了DI(多个DI可以指定name)和PHQL(重新定义它为Model的底层数据操作接口,支持批量插入与修改),进一步完善Model以及Event,增加了调试模式,精简了代码。 删除Volt、ODM,增加了QRcode、Captcha。
下面是框架MVC工作流程:
Startup Process
11.Register an autoloader 22.Create a DI - Phalcon\DI\FactoryDefault 33.Setup the view component 44.Setup a base URI 55.Handle the request - Phalcon\Mvc\Application::handle 6 5.1.Fire event – application:boot 7 5.2.Handle the URI pattern (if any) 8 5.3.Process the module definition (if any) 9 5.3.1.Fire event - application:beforeStartModule 10 5.3.2.Call method registerAutoloaders 11 5.3.3.Call method registerServices 12 5.3.3.Fire event - application:afterStartModule 13 5.4.Fire event – application:beforeHandleRequest 14 5.5.Dispatch – Phalcon\Mvc\Dispatcher::dispatch → Phalcon\Dispatcher::dispatch 15 5.5.1Fire event - dispatch:beforeDispatchLoop 16 5.5.2Dispatch loop 17 5.5.2.1.Fire event - dispatch:beforeDispatch 18 5.5.2.2.Create the complete controller class name 19 5.5.2.3.Load controller class 20 5.5.2.3.Check if the action exists in the controller 21 5.5.2.4.Fire event - dispatch:beforeExecuteRoute 22 5.5.2.5.Call the controller method beforeExecuteroute 23 5.5.2.5.Call the controller method initialize 24 5.5.2.4.Fire event - dispatch:afterInitialize 25 5.5.2.5.Call the action 26 5.5.2.6.Fire event - dispatch:afterExecuteRoute 27 5.5.2.7.Fire event - dispatch:afterDispatch 28 5.5.2.8.Call the controller method afterExecuteroute 29 5.5.2.9.Fire event - dispatch:afterDispatchLoop 30 5.5.2.10.Retrun the controller 31 5.6.Fire event – application:afterHandleRequest 32 5.7.Rendering Views 33 5.7.1.Fire event - application:viewRender 34 5.7.2.Call method – Phalcon\Mvc\View::render 35 5.7.2.1.Load the template engines 36 5.7.2.2.Fire event - view:beforeRender 37 5.7.2.3.Hierarchical Rendering 38 5.7.2.3.1Render action view 39 5.7.2.3.2Render before layout view 40 5.7.2.3.3Render controller layout view 41 5.7.2.3.4Render namespace layout view 42 5.7.2.3.5Render after layout view 43 5.7.2.3.6Render main view 44 5.7.2.4.Fire event - view:afterRender 45 5.8.Get the processed content - Phalcon\Mvc\View::getContent 46 5.9.Fire event - application:beforeSendResponse 47 5.10.Send headers - Phalcon\Http\Response::sendHeaders 48 5.11.Send cookies – Phalcon\Http\Response::sendCookies 49 5.12.Return the response
详细的请看:https://github.com/dreamsxin/cphalcon7/blob/master/docs/Phalcon.md