When saving the data are store in the model in the $data array. So you
can use :

$this->flash('The post \'' .$this->Post->data['Post']['name']. '\' has
been added.', '/
posts');

Do not mix $this->data at controller level and $this->Model->data.

Of course the field is present if it was saved (part of the $this-
>data used during save);

Hope this helps

On Aug 3, 7:35 pm, David <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> This is probably a stupid noob question but I wanted a bit more
> clarification on how the fields are stored in a model. When you call
> read() or save() on the model, is the data stored anywhere inside the
> model? For example, if I have this code in a controller:
>
> function add()
>         {
>                 if (!empty($this->data))
>                 {
>                         if ($this->Post->save($this->data))
>                         {
>                                 $this->flash('The post \'' . ????? . '\' has 
> been added.', '/
> posts');
>                         }
>                 }
>         }
>
> and I want to display the title of the post where the question marks
> are, can I use $this->Post->xxx? Or do I have to use the $data
> variable ($this->data['Merchant']['name'])?
>
> Thanks for your help, and sorry if this is a stupid question.
>
> David


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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