action, so amend your code as:
[code]
$this->set('photos', $this->paginate("Photo", array('Photo.gallery_id'
=> $id)));
[/code]
That should give you the photos from the chosen gallery.
If the above is not your issue, please clarify what exactly is your
issue! Is the photos not showing up? Is the gallery not showing up?
Enjoy,
John
On Feb 1, 8:36 am, Changoso <mmosc...@gmail.com> wrote:
> Hello, I know this might be kind of a newbie question but hope you
> could help.
>
> I have 2 tables, Galleries and Photos.
>
> One Gallery has many Photos
>
> On my Gallery View/$id I have the common: "Gallery related Photos"
> view.
>
> What I want is to paginate the Related Photos.
>
> I tried adding: $this->set('photos', $this->paginate("Photo")); in the
> View Function.
>
> so...
>
> function view($id = null) {
> if (!$id) {
> $this->Session->setFlash(__('Invalid Gallery.', true));
> $this->redirect(array('action'=>'index'));
> }
> $this->set('photos', $this->paginate("Photo"));
> $this->set('gallery', $this->Gallery->read(null, $id));
>
> }
>
> but its not working.. so... any idea?!
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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment