Php 未在Codeigniter框架中加载Css
我在Codeigniter中有这个代码文件,但是URL方法不起作用,也尝试一下,所以我不认为这里有问题Php 未在Codeigniter框架中加载Css,php,codeigniter,Php,Codeigniter,我在Codeigniter中有这个代码文件,但是URL方法不起作用,也尝试一下,所以我不认为这里有问题 通过helper$this->load->helper('html')加载 我做错了什么?字符串路径中有错误 asstes ---> assets 我认为最好编写自己的帮助程序,以便在CodeIgniter 3版本上添加资源(js、css…,只需检查您的基本url是否已设置,因为有时空白会导致链接无法正常工作 $config['base_url'] = 'http://localho
通过helper$this->load->helper('html')加载代码>
我做错了什么?字符串路径中有错误
asstes ---> assets
我认为最好编写自己的帮助程序,以便在CodeIgniter 3版本上添加资源(js、css…,只需检查您的基本url是否已设置,因为有时空白会导致链接无法正常工作
$config['base_url'] = 'http://localhost/your-project/';
控制器示例:Welcome.php
<?php
class Welcome extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->helper('html');
}
public function index() {
$this->load->view('welcome_message');
}
}
在你的头上标记视图
试试这种方法:-base_url('path/to/stylesheet.css');你怎么了?你试过我的答案了吗
$autoload['helper'] = array('url', 'html');
<html>
<head>
<?php echo link_tag('assets/css/bootstrap.css');?>
</head>
application
assets
system
index.php