I want to display the links of the first and previous record. I use the following code, but it returns empty.
$neighbors = $this->names->find('neighbors', array('conditions'=>array('names.Id'=>12),'limit'=>1));
This is my working code below, which returns data for the current record
$this->set("names", $this->names->find('all',array('conditions'=>array('names.Id'=>$id))));
How can i achieve this. Please help me.
thank
source
share