rex
template folder with a new name 404.rex.php
. This file will be placed directly into the rex/errors
directory. Once this is done, then the new 404.rex.php
file will automatically replace the default one.
self::wvm()
method. The example below illustrates this.
<?php use Window; class Home extends Window { function __construct() { self::wvm('error', 'my-custom-template'); self::call($this, [ 'home/user' => 'root', ]) } }
::404
template error key as one of the urls within the acceptable urls. The corresponding method
will then be called by the shutter if any error exists rather than call the default error page. The code below reveals how to
achieve this:
<?php use Window; class Home extends Window { function __construct() { self::call($this, [ 'home/user' => 'root', '::404' => 'error404()', ]) } function error404() { self::load('errors.error-template', fn() => compile() ); } }
::404
, that is, error404()
method will be triggered
if the url home/user
does not exist.