However, this appears to be causing a problem rendering error views.
For example, if I set a URL rule:
'test/<id:\d+>' => 'site/test' // Looking for a numeric digit, eg /test/123
If I visit /test/999, our controller code attempts to load model ID 999 (which doesn’t exist) and throws a 404 exception:
throw new CHttpException(404, 'Not Found');
This then renders the error view via site/error as per the error config:
'errorHandler' => array(
// use 'site/error' action to display errors
'errorAction' => 'site/error',
So that’s all good - working as expected.
However, if I visit /test/abc - which does not contain a matching numerical digit, Yii does not render the error view and I see an unstyled browser error page with no layout or view.
If I try to exit() inside site/error - nothing happens, it’s like Yii isn’t even using the site/error method. However if I remove the site/error method, Yii throws an error saying it can’t find the method!
Any ideas how I can use ‘useStrictParsing’ => true and still get Yii to render proper error view 404’s on non-matching URLs?