Control->recursive = 0; $controls = $this->Control->find('all'); $this->set(array( 'controls' => $controls, '_serialize' => array('controls') )); } /** * view method * * @throws NotFoundException * @param string $id * @return void */ public function view($id = null) { if (!$this->Control->exists($id)) { throw new NotFoundException(__('Invalid control')); } $options = array('conditions' => array('Control.' . $this->Control->primaryKey => $id)); $control = $this->Control->find('first', $options); $this->set(array( 'control' => $control, '_serialize' => array('control') )); } }