Wednesday, November 3, 2010

Re: Standard mechanism for telling why a record hasn't been deleted?

On Nov 3, 9:02 am, alaxos <ala...@gmail.com> wrote:
> Yes, but the point for me is that this solution needs really less
> code. Once you have modified the AppModel and the layout, it works for
> every controller and every action, without adding code in controllers.

and you can't turn it off.

Btw there's an onError callback which is in part for handling this
sort of thing.

>
> But it is a matter of choice... :-)

If you want something like that where's the hardship in using your app
controller beforeRender to look for the errors and set flash messages
appropriately or whatever display logic you choose. Mixing MVC to save
a line of code isn't going to save you anything the first time
someone, probably someone else, looks at your code and can't see
where or how these db errors they want to hide/modify/whatever are
coming from.

On the plus side, at least you used validation errors which is
contextually more relevant than creating a new variable for storing
your delete-only errors IMO.

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: