CodeIgniter - Form: Creating Layout Code
CodeIgniter Form Step By Step Tutorial - Part 3: At this post, we will write simple code for showing our layout. Follow this step:
- Open books.php within CodeIgniter\system\application\controllers. Enter following code:
<? class Books extends Controller{ function Books(){ parent::Controller(); } function main(){ $this->load->view('books_main'); } function input(){ $this->load->view('books_input'); } } ?> - Open books_main.php within CodeIgniter\system\application\views.
<html> <head></head> <body> <div id="header"> <? $this->load->view('books_header'); ?> </div> <div id="menu"> <? $this->load->view('books_menu'); ?> </div> test list <div id="footer"> <? $this->load->view('books_footer'); ?> </div> </body> </html>I think, it is simple to understand for you. Right?
- Open books_input.php within CodeIgniter\system\application\views.
<html> <head></head> <body> <div id="header"> <? $this->load->view('books_header'); ?> </div> <div id="menu"> <? $this->load->view('books_menu'); ?> </div> test input <div id="footer"> <? $this->load->view('books_footer'); ?> </div> </body> </html> - Open books_menu.php within CodeIgniter\system\application\views.
menu: <a href="main">List</a> | <a href="input">Input</a>
- Open books_header.php within CodeIgniter\system\application\views.
test header
- Open books_footer.php within CodeIgniter\system\application\views.
test footer
Now, point your browser to http://localhost/CodeIgniter/index.php/books/main

