1 系统 ubuntu 12.04,ip: 192.168.72.78
2 CodeIgniter版本:2.1.4
3 apache根目录 /var/www/html
4 CI根目录 /var/www/html/ci
5 config/config.php配置:
$config['base_url'] = 'http://192.168.72.78/ci/';
6 css 放置目录 /var/www/html/ci/css
7ci根目录下的访问文件权限控制文件,打开对css,js,img,images的直接访问控制
RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|img|css|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
8 控制器的构造函数:
public function __construct()
{
parent::__construct();
$this->load->helper('url');
}
9视图文件如何引用css文件
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href='<?=base_url().'css/button.css'?>' rel="stylesheet" type="text/css">
<div class="buttonContainer">
<a class="button large blue" href="192.168.72.78/main.php/gearman">Gearman</a>
<a class="button large blue" href="192.168.72.78/main.php/tuxedo">Tuxedo</a>
</div>
</html>
~
~
~