本文介绍了在CodeIgniter上集成Bootstrap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Codeigniter网站上使用引导程序,但似乎找不到引导程序文件
I'm trying to use bootstrap on a codeigniter web but it looks like the bootstrap files are not found
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="<?php echo base_url('application/bootstrap/css/bootstrap.min.css');?>" rel="stylesheet">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="<?php echo base_url('application/bootstrap/js/bootstrap.min.js');?>"></script>
我检查了base_url()生成的路径,它是正确的。
I've checked the paths generated by base_url() and it are correct.
推荐答案
将 bootstrap
文件夹移至根目录,因为CI正在理解 application
文件夹作为 controller
文件夹,尽管 /application/.htaccess 文件
move
bootstrap
folder on root location, because CI is understanding application
folder as controller
although application folder is restricted from client request by /application/.htaccess
file
|-
|-application
|-bootstrap
//and use path as
<?php echo base_url('bootstrap/css/bootstrap.min.css');?>
这篇关于在CodeIgniter上集成Bootstrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!