Hi
I'm trying to implement a simple gallery, which so far has gone well.
I'm now trying to create next/prev links when viewing the individual
images, which findNeighbours was clearly made for! :)
I'm getting confused over the parameters I need to pass it though:
// image_controller.php
function view($id = null) {
// Show the real image
$this->Image->id = $id;
$this->set('image', $this->Image->read());
$this->set('neighbours', $this->Image->findNeighbours(null,
'image.id', $id));
}
This works fine, however image with ID=2 may not necessarily be in the
same gallery as the current image with ID=1. Therefore I want to add a
condition into findNeighbours along the lines of gallery.id == current
image.gallery_id.
However, the following doesn't appear to work. I'm hoping I'm just
getting confused over $this, so it must be something simple..
function view($id = null) {
// Show the real image
$this->Image->id = $id;
$this->set('image', $this->Image->read());
$this->set('neighbours', $this->Image->findNeighbours("gallery.id"
== $this->$image['Image']['gallery_id'], 'image.id', $id));
}
The above gives me "unknown var: $image" - what have I missed/screwed?
A.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---