我的 css 文件仅在 index 函数调用的视图上可用,但其他函数我收到 404 错误,即找不到 css 文件。这是我的控制器
class Enumurator extends CI_Controller {
public $layout_view = 'layouts/default';
public function __construct()
{
parent::__construct();
$this->load->model('enumurators_model');
$this->load->helper('url');
}
public function index()
{
$this->load->library('layout');
$this->layout->title('Enumurators');
$data['enumurators'] = $this->enumurators_model->get_enumurators();
$this->layout->view('enumurators', $data);
}
public function addenumurator()
{
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->library('layout');
$data['title'] = 'Create Enumurator';
$this->form_validation->set_rules('fname', 'First Name', 'required');
$this->form_validation->set_rules('lname', 'Last Name', 'required');
$this->form_validation->set_rules('phone', 'Telephone', 'required');
$this->form_validation->set_rules('email', 'Email', 'required');
$this->form_validation->set_rules('phone', 'Phone', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
if ($this->form_validation->run() === FALSE)
{
$this->load->view('newenumurator');
}
和
这:“本地主机/错误/枚举器”它工作正常
但
这:“localhost/mis/enumurator/addenumurator”找不到css
任何帮助将不胜感激