• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL Problems with Includes.

#1
[eluser]austintbiggs[/eluser]
I'm trying to include
Quote:views/body/includes/document_head.php
from 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.

#2
[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');

#3
[eluser]patwork[/eluser]
You can't access local files with base_url(), because it's URL to your homepage. Try defined constant APPPATH.

#4
[eluser]toopay[/eluser]
@patwork

He wants to include/load a view files within a view files, not access it.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.