You cannot use $this->set in this situation because your are
redirecting the user; all data that you 'set' through your controller
will be lost. You would have to use the session or the URL in order to
pass this information.


On 18 juin, 12:26, gfs <[email protected]> wrote:
> Being new to CakePHP I am stuck on something I thought I understood...
>
> I am trying to use the $this->set method in the controller code to
> make some data available to the view but I am getting
> Undefined variable: images [APP/views/images/index.thtml, line 10]
>
> here is the code from the action in the controller....
>
> Whats not right ???
>
>  if ($this->Image->save($this->data)) {
>                                 $this->Session->setFlash('Image has
> been added.');
>                                 $this->set('images', 
> $this->Image->findAllByImages($this->data['Image']['images']));
>
>                                 $this->redirect('/images/index');
>
> }
>
> and the view code for now is just:
>
> <?php debug($images) ?>
>
> I have verified that the value returned from the findAllBy.... method
> is actually something...
--~--~---------~--~----~------------~-------~--~----~
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