![]() |
Creating a Basic CMS system - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Creating a Basic CMS system (/showthread.php?tid=12448) |
Creating a Basic CMS system - El Forum - 10-19-2008 [eluser]edwin87[/eluser] Hello CI! First of all, i love the way CI stuck so much time in developing this framework. I just started with CI, so i am very new in this. (Excuse me for my bad english ![]() What i want is a basic cms system. I have already created a login script and every time my page load it will check if the session still exists. This option i've built with a own controller, named: MY_Controller. If i am logged succesfully, the page includes an header, so i don't have to include it in every specific controller. But for now, i want to built a page module. So i can create/edit/delete pages. Here for i have a page controller what includes al the functions i need. But this controller loads above the MY_Controller i think. When i want to show a basic text like 'hello world', then that text is above the included header file. What did i do wrong in this matter? I'm from Holland and my english is very very bad, so i hope that a fool can help me ![]() Edwin Creating a Basic CMS system - El Forum - 10-20-2008 [eluser]Aken[/eluser] Any content you want to display on a page should be inserted into a view, instead of directly from the controller. You insert any content via an array, and then pull the data inside the view. Controller: Code: // Your header view would go here. view.php: Code: <p><?php echo $text; ?></p> Creating a Basic CMS system - El Forum - 10-20-2008 [eluser]Mirage[/eluser] Quote:Any content you want to display on a page should be inserted into a view, instead of directly from the controller. You insert any content via an array, and then pull the data inside the view. That's not the only way. You can also draw the view data from the Model directly and via View helpers. Cheers- m Creating a Basic CMS system - El Forum - 10-20-2008 [eluser]edwin87[/eluser] I already tried that before. But still that content echo's above the included header. Maybe i don't understand the procedure of CI but here's a example. In the folder libaries i have the following file: MY_Controller.php Code: <?php The header file look like this: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> So if i click on 'Pagina' in the menu structure. I want to open that page view beneath <div id="content"> but it now opens above the source. Like Code: [b]I want to open the page file[/b] You see 'I want to open the page file' above the source, now i want it beneath <div id="content"> How can i make this happen? Maybe im wrong with the whole structure but can somebody help me with this? |