Phalcon7 给你足够的自由

Stella981
• 阅读 474

基于Phalcon框架1.3版本开发,继承优化了DI(多个DI可以指定name)和PHQL(重新定义它为Model的底层数据操作接口,支持批量插入与修改),进一步完善Model以及Event,增加了调试模式,精简了代码。 删除Volt、ODM,增加了QRcode、Captcha。

下面是框架MVC工作流程:

Startup Process

1.Register an autoloader
2.Create a DI - Phalcon\DI\FactoryDefault
3.Setup the view component
4.Setup a base URI 
5.Handle the request - Phalcon\Mvc\Application::handle
    5.1.Fire event – application:boot
    5.2.Handle the URI pattern (if any)
    5.3.Process the module definition (if any)
        5.3.1.Fire event  - application:beforeStartModule
        5.3.2.Call method registerAutoloaders
        5.3.3.Call method registerServices
        5.3.3.Fire event - application:afterStartModule
    5.4.Fire event – application:beforeHandleRequest
    5.5.Dispatch – Phalcon\Mvc\Dispatcher::dispatch → Phalcon\Dispatcher::dispatch
        5.5.1Fire event - dispatch:beforeDispatchLoop
        5.5.2Dispatch loop
            5.5.2.1.Fire event - dispatch:beforeDispatch
            5.5.2.2.Create the complete controller class name
            5.5.2.3.Load controller class
            5.5.2.3.Check if the action exists in the controller
            5.5.2.4.Fire event - dispatch:beforeExecuteRoute
            5.5.2.5.Call the controller method beforeExecuteroute
            5.5.2.5.Call the controller method initialize
            5.5.2.4.Fire event - dispatch:afterInitialize
            5.5.2.5.Call the action
            5.5.2.6.Fire event - dispatch:afterExecuteRoute
            5.5.2.7.Fire event  - dispatch:afterDispatch
            5.5.2.8.Call the controller method afterExecuteroute
            5.5.2.9.Fire event - dispatch:afterDispatchLoop
            5.5.2.10.Retrun the controller
        5.6.Fire event – application:afterHandleRequest
        5.7.Rendering Views
            5.7.1.Fire event - application:viewRender
            5.7.2.Call method – Phalcon\Mvc\View::render
                5.7.2.1.Load the template engines
                5.7.2.2.Fire event  - view:beforeRender
                5.7.2.3.Hierarchical Rendering
                    5.7.2.3.1Render action view 
                    5.7.2.3.2Render before layout view
                    5.7.2.3.3Render controller layout view
                    5.7.2.3.4Render namespace layout view
                    5.7.2.3.5Render after layout view
                    5.7.2.3.6Render main view
                5.7.2.4.Fire event - view:afterRender
        5.8.Get the processed content - Phalcon\Mvc\View::getContent
        5.9.Fire event - application:beforeSendResponse
        5.10.Send headers - Phalcon\Http\Response::sendHeaders
        5.11.Send cookies – Phalcon\Http\Response::sendCookies
        5.12.Return the response

详细的请看:https://github.com/dreamsxin/cphalcon7/blob/master/docs/Phalcon.md

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Peter20 Peter20
3年前
mysql中like用法
like的通配符有两种%(百分号):代表零个、一个或者多个字符。\(下划线):代表一个数字或者字符。1\.name以"李"开头wherenamelike'李%'2\.name中包含"云",“云”可以在任何位置wherenamelike'%云%'3\.第二个和第三个字符是0的值wheresalarylike'\00%'4\
Stella981 Stella981
2年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Stella981 Stella981
2年前
Phalcon7发布1.1.0版
合并Phalcon\Mvc\Model\Validator\到Phalcon\Validation\Validator\统一验证类。优化表单类,更加方便的创建新的表单元素,并支持转换为数组,提供给前端JS动态生成表单。内置支持HMVC。强化Model,更加方便的自定义字段和映射字段。完善了文档。<?php
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这