What is the way to validate the record id of an action containing an edit
form, an forward to error404 if not found? I'm thinking of 2 ways to do
that:

1. Try to pull the record from db in the action, and, if not found, return
'NotFound', and, in the 'NotFound' view, forward to actions.error404_*

or:

2. Create a validator class that takes the id parameter, fetch the record
and export() it to the action, and make a handleError() method like this:
    public function handleError() {
        if
($this->getContainer()->getValidationManager()->isFieldFailed('id')) {
            return 'NotFound';
        }
        return 'Error';
    }
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to