tp框架面向切面编程之行为Behavior分析

面向切面是一种设置模式

把一个大块的功能给分解为小块的功能,小块功能利于开发、维护、升级、部署

tp框架的行为 Behavior如何执行:

1、框架执行流程分析:index.php   ThinkPHP.php  Think.class.php App.class.php

2、Think::start();

3、ThinkPHP/Conf/Mode/common.php  tags标签内容是行为的内容

4、自定义shop/Common/conf/tags.php文件

5、自定义tags.php 内容会覆盖指定 的common.php的配置内容

App.class.php

1、function run();

2、Hook::listen('ap_begin');

3、ThinkPHP/Library/Think/Hook.class.php

4、function listen()

5、tags标签的内容解析为:CheckLang

6、self::exec('CheckLang');

7、function exec()

8、CheckLangBehavior

9、new CheckLangBehavior;

10、obj->run();、、运行具体行为

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值