validation - Validating actions in Symfony (PHP) -


I'm reading some sample documentation about verification / error-management for controllers.

Verification and error-handling methods (less than 2-thirds only)

I think the idea of ​​a function is being automatically called - to be executed Before the new action is called the modulation, and what type of scene you can control, for example, myActionSucess or myActionError is used.

However, it does not seem to work with Symphony 1.4, I have been denied such error handling / recognition, so I'm not sure how I do it with Symphony 1.4 I am here.

I know that pre and post execution work do something similar, but I like to do a dedicated verification work for each action.

Or am I using filters now?

Thanks for any help / advice

  public work preExecute () {$ Method = 'validate' $ This- & gt; ActionName (); If (method_exists ($ this, $ method)) {if (! $ This-> {$ method} ()) {return sfView :: error; }}}  

Such a thing can duplicate a validator function for each such action, but then my next question is, what is the best way to display errors? Something like setting an error diagram in the valid function, then a check is set in the template / view for the error all and then displaying relevant information. After this, it can be expanded for warning / notice.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -