I’m not sure, but there was a discussion about it and the answer was “no”.
See the possible implementation proposed by Cebe.
url rules:
// other rules here
'user/<action>' => 'user/missing',
'<controller>/<action>' => 'site/missing',
controllers:
class UserController
{
public function actionMissing($action)
{
// do whatever you want
}
}
class SiteController
{
public function actionMissing($controller, $action)
{
// do whatever you want
}
}
I have a controller and I would like to customize when someone request an action that doesn’t exit .
This controller has three actions . I would like to handle in my way any bad request.
Now if I call a missing action I get an 404 error Unable to resolve the request:
Something like this : domain/index.php/controller_name/missing_action and the response to be customize . Let’s say I would like to get : My error bad request.