Welcome Guest, Not a member yet? Register   Sign In
Include not working after putting view files inside another folder
#11

[eluser]PhilTem[/eluser]
Code:
$this->load->view('sub/subsub/file');
works as long as you don't have any typos in it. There's actually no magic behind being able to use any directory-separator in the argument, since the view-method() uses PHP's file_exist() (or something like that) to determine, whether a file relative to APPPATH . 'views/' exists. The only reason a file would not be included is because the file-path does not match - the first place to search for solving this error is looking for typos Wink

On the other hand, have you tried not changing your include statement? I'm currently not quite sure, but I guess all paths used in include or require or include_once or require_once are always relative to FCPATH (where index.php is located at) thus changing it in a view would lead to errors since the actual file isn't moved at all. So back to my question: Have you tried not changing the include-path?




Theme © iAndrew 2016 - Forum software by © MyBB