PHP basic to CI? |
[eluser]JingCleoVil[/eluser]
I am new from CI this is just I wanted to know to have a Master Page so that i will not redundantly make the layout in all pages. Here is my basic code. index.php - This is my Master Page. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" nav.php - my main navigation Code: <ul id="navigation"> home.php - my main page Code: <div class="main_content"> home.php - About US Code: <div class="main_content"> Its obviously when you click "about us" link the page will display here Code: <div id="cont_main"> Now I just wanted to do a basic CI code to make this thing happen same process but CI made .Thanks! PS: SOrry for my English.
[eluser]derekmichaeljohnson[/eluser]
This is indeed a popular question. Try http://maestric.com/en/doc/php/codeigniter_template You can also load views within views like so: Code: <html>
[eluser]JingCleoVil[/eluser]
Ok thanks.let me try using the code you provided.
[eluser]JingCleoVil[/eluser]
I try but something wrong with nav.Here is what I did. controller/welcome.php Code: <?php view/template.php Code: <html> library/Template.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); All things works fine on Loading but when you click the link it will not Received by "$contents" and it goes to 404 error. Instead of loading here "<div id="contents"><?= $contents ?></div>" the page will goes to http://localhost/myci/index.php/about and says 404 error. thanks again! |
Welcome Guest, Not a member yet? Register Sign In |