Welcome Guest, Not a member yet? Register   Sign In
Access custom application folder from controller
#1

[eluser]adamtong[/eluser]
Hi,

I followed the instructions in the use's guide.

At this page: http://ellislab.com/codeigniter/user-gui...pages.html

You can find this code:

Code:
public function view($page = 'home')
{

if ( ! file_exists('application/views/pages/'.$page.'.php'))
{
  // Whoops, we don't have a page for that!
  show_404();
}

$data['title'] = ucfirst($page); // Capitalize the first letter

$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);

}

Because I choosed a different application and system folders, the file_exists test failes (Just by commenting that test the views show correctly).

In my opinion a solution would be to put the variable that containes the value of the application folder full path defined in index.php instead of putting just "application". But in this case that variable should be accessible from the controller.

How can I fix this?


Messages In This Thread
Access custom application folder from controller - by El Forum - 09-27-2013, 04:29 PM
Access custom application folder from controller - by El Forum - 09-28-2013, 08:48 AM
Access custom application folder from controller - by El Forum - 09-28-2013, 09:04 AM
Access custom application folder from controller - by El Forum - 09-28-2013, 01:54 PM
Access custom application folder from controller - by El Forum - 09-28-2013, 08:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB