【杂记】:引用( 如&get_item() )不能直接赋给静态变量如$static,可是能够这样:$static[0] = &get_item()php
一:http://www.cnblogs.com/mier/archive/2009/05/04/1448431.html 详解PHP框架codeigniter(简称CI)如何实现MVC模式以及单一入口html
浅析Apache中RewriteRule和RewriteCond规则参数的详细介绍服务器
一开始老是失败的原始是在Apache的配置上.起做用的配置文件有两个:httpd.conf和vhost.conf.其中vhost.conf中的一行为:Options -Indexes -FollowSymLinks +ExecCGI,将其中的-变为+就好了。CI根目录下的.htaccess中的代码为:框架
#注意:这里只是去掉index.php, 若是网站根目录下还有一层(好比/CodeIgniter-3.1.6)那么访问时这一级仍然仍是要加上的。固然能够在其余地方过滤掉,
可是这里不能省略)
<ifModule mod_rewrite.c>
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /CodeIgniter-3.1.6/index.php/$1 [L] </ifModule> 网站根目录是xxx/www,CI位于www之下。通过本身的测试,最后一行代码其实变为RewriteRule ^(.*)$ index.php/$1 [L]也能够。
上不明白这些代码具体什么意思。之后研究。
====================================================================
二次研究:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
# 含义解释: 除已存在的目录和文件,其余的 HTTP 请求都会通过你的 index.php 文件。
# 如下内容只是推测:
# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
# 注: http://localhost/CodeIgniter-3.1.7/welcome会被解析为
# http://localhost/CodeIgniter-3.1.7/index.php/welcome
# RewriteRule ^(.*)$ /index.php/$1 [QSA,PT,L] /表示网站根目录
# 注: http://localhost/CodeIgniter-3.1.7/welcome会被解析为
# http://localhost/index.php/welcome
#解释:index.php所在目录是http://localhost/CodeIgniter-3.1.7/,
#规则中的(.*)捕获的是上面所述网址后面的全部部分,便是welcome,而后将其
#替换$1,若是规则是index.php/$1则将替换后的index.php/welcome放在上面
#所述网址的后面(即代替原来的welcome),即:http://localhost/CodeIgniter-3.1.7/index.php/welcome
#而若是规则是/index.php/$1则将替换后的index.php/welcome放在服务器配置的
#网站根目录后(即代替网站根目录后的全部部分)即:http://localhost/index.php/welcome
三,CI文件加载流程:函数