I have a problem based on this question.
Same DB: Project has many Keywords - Keyword belongs to Project
To access the Project Table
in Keywords/index.ctp
easily use $keyword['Project']['id']
;
But conversely it seems a bit more difficult. Here a bit code:
public function view($id = null)
{
if (!$id)
{
throw new NotFoundException(__('Invalid project'));
}
$this->paginate['Project']['conditions'] = array('Project.id' => $id);
$this->set('projects', $this->paginate());
$this->set('project', $project);
}
in Projects/view
I try to access the Keywords table like that: $project['Keyword']['id']
what I might expected that this isn't working.