Hey, that worked perfectly, thanks for the help :)
On May 8, 9:27 pm, dreamingmind dreamingmin...@gmail.com wrote:
Barricades,
I think your concern about the beforeSave/afterSave issues are red
herrings. Since the first line of your code is:
if ($this-Campaign-save($this-data)) { ...
both
Thanks for the reply :)
The find after the save isn't returning what I want it to. In fact I'm
not sure it's returning anything at all. Baring in mind I'm a total
newbie (not even that much of a php'er either yet) what I want it
simply somehow (what I've done is just my best guess - I've no idea
Barricades,
I think your concern about the beforeSave/afterSave issues are red
herrings. Since the first line of your code is:
if ($this-Campaign-save($this-data)) { ...
both the before and after are finished. And you are only getting
inside the 'if' statement when the save was successful. Of
$this-redirect(array('action' = 'view', 'id' = $slug));
hth... Claudio
On 7 maio, 13:22, barricades davow...@googlemail.com wrote:
Hi, I'm new so please don't shout at me for the stupid question but...
When I save a record I want to redirect straight to the record I just
created. The
Hi, I'm new so please don't shout at me for the stupid question but...
When I save a record I want to redirect straight to the record I just
created. The record which I have just created uses sluggable behaviour
to create a slug in a beforeSave, so I can't just use $this-
data['Campaign]['slug']
Barricades,
You don't really say WHERE the process seems to break down. The find
after the save seems suspicious to me. Is that returning the proper
slug to pass along to your view function? It looks like $slug will end
up holding the returned data array rather than the returned string
from the