URL Problems with Includes. - 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: URL Problems with Includes. (/showthread.php?tid=40941) |
URL Problems with Includes. - El Forum - 04-23-2011 [eluser]austintbiggs[/eluser] I'm trying to include Quote:views/body/includes/document_head.phpfrom within Quote:views/body/layout.php using Code: <?php $baseurl = base_url(); $this->load->view($baseurl . 'body/includes/document_head.php'); ?> It's just not working, I'm bad when it comes to URL mapping, anyone have any advice? Thanks. URL Problems with Includes. - El Forum - 04-23-2011 [eluser]toopay[/eluser] To use load->view, you doesn't need to provide the full path. Its should... Code: $this->load->view('body/includes/document_head'); URL Problems with Includes. - El Forum - 04-23-2011 [eluser]patwork[/eluser] You can't access local files with base_url(), because it's URL to your homepage. Try defined constant APPPATH. URL Problems with Includes. - El Forum - 04-23-2011 [eluser]toopay[/eluser] @patwork He wants to include/load a view files within a view files, not access it. |