public function init()
{
$this->addHookBefore('ProcessController::execute', $this, 'someMethod');
}
public function someMethod($event)
{
// also how do I access the $_SERVER variables from processwire point of view
}
Also how do I access the $_SERVER variables from a PW context. Something like $pages->get('SERVER').
Hook before a 404 exception
in Module/Plugin Development
Posted
Hi,
Thank you for the wonderful CMF. This is my first question to the PW community as I started with it.
I am in the process of trying to create a module. The basic need is I want to change the content of the 404 page, if the route is something special.
Eg : say the request is for http://processwire.localhost/hello and if I know the path doesn't exists I want to do something special.
Also how do I access the $_SERVER variables from a PW context. Something like $pages->get('SERVER').