CodeIgniter is a powerful PHP framework
with a very small footprint, built for PHP
coders who need a simple and elegant
toolkit to create full-featured web
applications. If you‘re a developer who
lives in the real world of shared hosting
accounts and clients with deadlines, and if
you’re tired of ponderously large and
thoroughly undocumented frameworks.
CodeIgniter 的那些事
CI 的构架
Design and Architectural Goals
Our goal for CodeIgniter is maximum performance, capability, and
flexibility in the smallest, lightest possible package.
特性
� dynamically instantiated
� loosely coupled
� high component singularity
CodeIgniter 的那些事
CI 的构架-MVC
Model
和各种数据源打交道,包含但不限于数据库的数据,建立数据源与 php
变量的关联
View
CI php html
表现给用户看的内容, 使用的是原生态的 作为 模板,效率很高
Controller
处理业务逻辑,协调Model的工作,支持View的工作,以实现业务请求
CodeIgniter 的那些事
CI
-
的构架 单入口文件
�对所有请求都能有效的初始化所需资源,包括
安全处理。
�CI并不是强制的只有一个文件,而是一个应用
程序只有唯一的入口。
的构架 应用与系统文件的分离
�CI中index.php文件的第一个PHP语句设置就是
当前所在的运行环境。
CodeIgniter 的那些事
CI -
的构架 可扩展性(文件)
扩展方式
�创建全新的
�扩展原始的 前缀
MY_
�替换原始的 前缀
CI_
CI
CI
CCII 框架的自身大部分组件可以被扩展
�Library, Core class
�Drivers
�Helpers