Hi Clark,

Thank you for answer.

I don't redirect after find, it's an error in my first post. I would
like to redirect after save!

I know it's a bad idea to redirect from Model, but I'm looking for a
solution to stop action after a record save, like the return false in
before Save.

In fact, in my Model::afterSave, I do a "move_uploaded_file()" and if
this move doesn't work, I would like to redirect in the previous
controller action instead of the redirect(index)

Sorry for my simple English, I hope this message is understandable...



On 30 avr, 17:46, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> You shouldn't redirect from a model as a model should only be dealing
> with data, not page logic.
>
> You should be doing the redirect in your controller.
>
> What are you redirecting for anyway? If you redirect after finding
> data, you'll lose that data and have to find again.
>
> On Apr 30, 11:36 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > Is it possible to redirect from the Model?
> > I would like to redirect in an specific action from "afterFind()"
> > callback... but if I set "return false" in this callback, like it's
> > possible in "beforeSave()", I can't redirect!
>
> > Thanks by advance for your ideas.
>
> > BR
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to