I have a controller called articles
, which creates the articles model which gets the relevant data from the database.
I want to, if the method I call return
Kohana Docs tells you way to do it:
throw HTTP_Exception::factory(404, 'File not found!');
Kohana / General / Error-handling / Kohana_404_Exception
/**
* @param string URL of page
* @param string custom error template
*/
throw new Kohana_404_Exception([string $page [, string $template]]);
This works for me:
Event::run('system.404');
What version of Kohana are you using?