[eluser]Ki[/eluser]
I have a help section, which has about 10 sub sections, such as about, FAQ, etc. Instead of creating a method for every page, I just pass them to index page with _remap and then load them based on the $page variable. So /home/contact_us will go to Home controller, index method and "contact_us" is passed as variable $page. This allows me to change, add, remove help pages without writing/deleting methods for each. But I discovered that if user types in /home/contact_ussssss, it will throw the tragically unpleasant
Code:
An Error Was Encountered
Unable to load the requested file: content/help/contact_ussssss_view.php
1) Is there a way to customize this, similar to 404?
2) Any way to check if $this->load->view('content/help/'.$page.'_view', $this->data, TRUE) returns FALSE?
I have tried:
Code:
if($this->data['content'] = $this->load->view('content/help/'.$page.'_view', $this->data, TRUE)){
// do nothing
}
else{
$this->data['content'] = $this->load->view('content/help/help_main_view', $this->data, TRUE);
}