我试图找出来。
只是试图找到正确完成它的正确方法,我正在查看帮助索引,但有点困惑。
我的控制器/通用文件中有三个控制器,分别称为 home.php、header.php、footer.php
我已将 home.php 控制器设置为我的默认控制器。
我尝试像这样将页眉和页脚控制器链接添加到主控制器
this->load->view('common/home');
$this->children = array(
'common/footer',
'common/header'
);
在视图部分
<?php echo $header; ?>
<div id="body">
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
<p>If you would like to edit this page you'll find it located at:</p>
<code>application/views/common/home.php</code>
<p>The corresponding controller for this page is found at:</p>
<code>application/controllers/common/home.php</code>
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
</div>
<?php echo $footer; ?>
但是控制器文件中的链接不适用于页眉和页脚。我在哪里可以找到正确的方法,以便将页眉和页脚回显到视图页面。