Yii 模式
Yii中使用了当前Web开发中最为主流和成熟的设计模式。包括依MVC模式、依赖注入(Denpdency Injection, DI)和服务定位器(Service Locator)等种模式。 这里将结合Web应用和Yii具体实现进行探讨,以加深印象和理解。学习这些设计模式对于提高自身的设计水平很有帮助, 这也是我们学习Yii的一个重要出发点。
- MVC
- MVC的三要素
- Model设计参考
- Model应当集中整个应用的数据和业务逻辑
- 基础Model应当尽可能细化
- 分层次设计Model
- 仔细为Model方法命名
- MVC与前后端的配合
- 依赖注入和依赖注入容器
- 有关概念
- 依赖注入
- DI容器
- DI容器中的内容
- 注册依赖
- 对象的实例化
- 实例分析
- 服务定位器(Service Locator)
- Service Locator的基本功能
- Service Locator的数据结构
- 访问Service Locator中的服务
- 通过Service Locator获取实例
- 在Yii应用中使用Service Locator和DI容器
- DI容器的引入
- Application的本质
- 实例创建方法
- Yii创建实例的全过程
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_1775.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57