For performance reasons (mainly avoiding stat calls), BjyAuthorize uses the template map to define which file to use when the error/403
view is requested. This is an option of the view_manager
settings, as described in the Zend\View
documentation.
To set your own, you can simply define something like following in your config/autoload/your-settings.local.php
:
'view_manager' => array(
'template_map' => array(
'error/403' => '/absolute/path/to/your/error/403.phtml',
),
),
Or, in your module config:
'view_manager' => array(
'template_map' => array(
'error/403' => __DIR__ . '/view/error/403.phtml',
),
),
I suggest always providing absolute paths for configuration, so be sure that your file C:\myproject\config\autoload/../view/error/403.phtml
is the correct path.
You can also use a different view for 403 errors if you prefer to do so. That can be achieved by changing $config['bjyauthorize']['template']
:
'bjyauthorize' => array(
'template' => 'my-module/unauthorized-template',
),