从fuel cms来研究ci框架
首先fuel cms是基于CI的,都是单一入口
在本地localhost目录下面有index.php和.htaccess
index.php 是定义一些基础常量,然后载入fuel/codeigniter/core/CodeIgniter.php文件,这个文件就是单一入口,先寻找路由(默认控制器类为page_router 方法index),然后通过Output类来显示(分为有缓存和无缓存两种方式) 这个单一文件基本上概括了整站的架构
再来看一下.htaccess文件
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
Options +FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / <Files .*> Order Deny,Allow Deny From All </Files> # Allow asset folders through RewriteRule ^(fuel/modules/(.+)?/assets/(.+)) - [L] # Protect application and system files from being viewed RewriteRule ^(fuel/install/.+|fuel/crons/.+|fuel/data_backup/.+|fuel/codeigniter/.+|fuel/modules/.+|fuel/application/.+|\.git.+) - [F,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [L] </IfModule> Options -Indexes
RewriteRule .* index.php/$0 [L] 表示在主机后面加入index.php这个文件进入单一入口
# Protect application and system files from being viewed
RewriteRule ^(fuel/install/.+|fuel/crons/.+|fuel/data_backup/.+|fuel/codeigniter/.+|fuel/modules/.+|fuel/application/.+|\.git.+) - [F,L] fuel目录下除了传统CI的application、codeigniter目录还多出来moduels目录blog、backup、seo、tester等控制器。
然后要强调的是header、footer等block块,以及theme、layouts布局