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.
But it is a matter of choice... :-) On Nov 3, 2:24 am, cricket <[email protected]> wrote: > On Tue, Nov 2, 2010 at 6:31 PM, alaxos <[email protected]> wrote: > > Hi, > > > Personally for these kinds of errors, I prefer to rely on the errors > > raised by the database. > > > However, AFAIK, CakePHP does not return these errors automatically. I > > found a solution, but it uses a very discussed technique: accessing > > the Session in the model layer. It could also use a model variable > > instead, that would be then read in the controller actions, but this > > would mean updating a lot of them... > > Or you could just let the controller get the error from the model and > set it for the view. Far less complicated. 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
