public function taskDetail($id=null) { $tasks = $this->Task->findById($id); $this->set('tasks', $tasks); //load task detail $this->loadModel('Taskdetail'); $ListTaskdetail = $this->Taskdetail->find('all', array( 'conditions' => array( 'Taskdetail.taskid' => $id, ) )); $this->set('ListTaskdetail', $ListTaskdetail); $this->set('taskid', $id); $this->loadModel('Notification'); $Notifications = $this->Notification->find('all', array( 'conditions' => array( 'Notification.projectid' => $tasks['Task']['projectid'], ) )); $this->set('Notifications', $Notifications); }