![]() |
basic stuff, include a view in a main php file - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: basic stuff, include a view in a main php file (/showthread.php?tid=6592) |
basic stuff, include a view in a main php file - El Forum - 03-04-2008 [eluser]alebenson[/eluser] hi there!... yes i know this is basic stuff but i cant figure i have the main page.php (that is not created by CI)... but i want to add a feature, like a sidebar. i have a sidebar_left_view and the controller but i dont know how to mix that with the page.php i try with Code: <?php include (site_url("sidebar/left"));?> but doesnt work... any ideas? thanks basic stuff, include a view in a main php file - El Forum - 03-04-2008 [eluser]wiredesignz[/eluser] Two things, your are using a full URL to the file which probably won't work, and include needs filename.extension basic stuff, include a view in a main php file - El Forum - 03-05-2008 [eluser]alebenson[/eluser] Well i was reading the User Guide about Views and gives an example of multiples views Code: class Page extends Controller { what can i do, if the 'menu' need some vars to be passed ? ok, i guess like 'content' adding $data, but the $data for the menu, is on the Menu Controller, and not in the Page controller thanks! basic stuff, include a view in a main php file - El Forum - 03-05-2008 [eluser]xwero[/eluser] I like to use variables that reflect the name of the view file for easy troubleshooting Code: class Page extends Controller { basic stuff, include a view in a main php file - El Forum - 03-05-2008 [eluser]alebenson[/eluser] THANKS xwero!!! i did it! |