CodeIgniter Form Step By Step Tutorial - Part 5: We put menu below header. But we still don't talk about header. Now, we will put some text at header. If you remember, this step is like this post.
Open you controller, "books.php" within CodeIgniter\system\application\controllers. Update like this:
<?
class Books extends Controller{
function Books(){
parent::Controller();
}
function main(){
$this->load->library('MyMenu');
$menu = new MyMenu;
$data['menu'] = $menu->show_menu();
$data['webtitle'] = 'Book Collection';
$data['websubtitle']= 'We collect
all title of books on the world';
$data['webfooter'] = '© copyright
by step by step php tutorial';
$this->load->view('books_main',$data);
}
function input(){
$this->load->library('MyMenu');
$menu = new MyMenu;
$data['menu'] = $menu->show_menu();
$data['webtitle'] = 'Book Collection';
$data['websubtitle']= 'We collect
all title of books on the world';
$data['webfooter'] = '© copyright
by step by step php tutorial';
$this->load->view('books_input',$data);
}
}
?>
Then update header, "books_header.php" within CodeIgniter\system\application\views.
<h1 id="title">
<?php echo $webtitle; ?>
</h1>
<h2>
<?php echo $websubtitle; ?>
</h2>
Last, update footer, "books_footer.php" within CodeIgniter\system\application\views.
<?php echo $webfooter; ?>
Result like this:
