Throw a 404 error

Permalink
How do I throw a 404 error, I want to do this from a block.

In Concrete 5.6 I could do:

$v = View::getInstance();
$v->render('/page_not_found');

But this doesn't seem to work anymore, I get the following error:

include(/Library/WebServer/Documents/site/concrete/views/.php): failed to open stream: No such file or directory

Does anyone know the best method?

Many thanks

bvcreative
View Replies:
Mnkras replied on at Permalink Reply
Mnkras
in 5.7 from your controller you can do:

$this->replace('/page_not_found');


where $this is an instance of PageController
bvcreative replied on at Permalink Reply
bvcreative
Hi Mnkras

Thanks for your response, unfortunately I get a Call to undefined method error. I am trying this from a block rather than a page though.

Many thanks