我无法在 codeigniter 中仅配置 css 模板。例如:我是 codeigniter 的初学者。任何人都可以告诉我如何配置它或任何教程。
希望你能理解我糟糕的英语..
这是我的代码
在查看页面home.php
<?php $this->load->view('header_final');?>
<div id="page">
<div id="page-bgtop">
<div id="page-bgbtm">
<div id="content">
<div class="post">
<h2 class="title"><a href="#">Home</a></h2><br>
<div class="entry">
<p><img src="<?=site_url();?>images/img08.jpg" width="538" height="200" alt="" /></p>
<p>Sylhet Engineering College (SEC), established in the year 2007 under the School of Applied Science and Technology, Shahjalal University of Science and Technology is best of its kind with a motto to produce the best in class engineers for the 21st century in Bangladesh. There are five universities of Engineering and Technology and some private universities in the country for providing engineering education at B.Sc level which is not sufficient to meet the requirement of today's fast paced engineering sector of Bangladesh. As a divisional city of Bangladesh, Sylhet had no engineering institute. So the Government of Peoples Republic of Bangladesh has established Sylhet Engineering College with a vision to expand the engineering education of Bangladesh as an engineering faculty section of Shahjalal University of Science and Technology.</p>
</div>
</div>
<div class="post">
</div>
<div style="clear: both;"> </div>
</div>
<!-- end #content -->
<?php $this->load->view('footer_final');?>
在 Controller 页面 home.php
<?php
class Home extends Controller {
function Home()
{
parent::Controller();
}
function index()
{
$this->load->view('home');
}
}
提示:
header_final.php
和 footer-final.php
最佳答案
CodeIgniter 允许您同时加载多个 View 。您想将 View 加载留在 Controller 中。所以你想要做的是在 Controller 中加载页眉 View ,然后加载你想要呈现的实际 View ,然后加载页脚 View 。完成后它看起来像这样:
function index(){
$this->load->view('header_final');
$this->load->view('home');
$this->load->view('footer_final');
}
然后从您的 home.php View 中删除所有 View 加载。
关于php - 需要帮助在 codeigniter 中配置 CSS 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5794670/