对框架中文件的所有请求都需要经过index.php处理完成,当加载外部的css和js文件的时候要使
用base_url()函数处理外部的链接。
在控制器中需要先载入url相关的类
public function test(){ $this->load->helper('url'); $this->load->view('admin/test');} 在test.php的view视图中。
可以用
css/min.css" />
输出基本的路径名。
需要在配置文件config.php中声明
$config['base_url'] = 'http://127.0.0.1/company/';
这样就可以正常加载了