Created
October 8, 2014 10:18
-
-
Save dakota/d5c5e595d98be0673dd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo $this->Form->create($applicant); | |
echo $this->Form->input('first_name'); | |
echo $this->Form->input('surname'); | |
echo $this->Form->input('applicant_subjects.0.subject_id'); | |
echo $this->Form->input('applicant_subjects.0.description'); | |
echo $this->Form->input('applicant_subjects.1.subject_id'); | |
echo $this->Form->input('applicant_subjects.1.description'); | |
echo $this->Form->submit(); | |
echo $this->Form->end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function add() { | |
$applicant = $this->Applicants->newEntity($this->request->data); | |
debug($applicant); | |
$subjects = $this->Applicants->ApplicantSubjects->Subjects->find('list'); | |
$this->set('subjects', $subjects); | |
$this->set('applicant', $applicant); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object(HesaMbit\Model\Entity\Applicant) { | |
'new' => true, | |
'accessible' => [ | |
'*' => true | |
], | |
'properties' => [ | |
'first_name' => 'My test guy', | |
'surname' => 'surname for him', | |
'applicant_subjects' => [ | |
(int) 0 => object(HesaMbit\Model\Entity\ApplicantSubject) { | |
'new' => true, | |
'accessible' => [ | |
'*' => true | |
], | |
'properties' => [ | |
'subject_id' => 'anmu', | |
'description' => 'Subject description' | |
], | |
'dirty' => [ | |
'subject_id' => true, | |
'description' => true | |
], | |
'original' => [], | |
'virtual' => [], | |
'errors' => [], | |
'repository' => 'ApplicantSubjects' | |
}, | |
(int) 1 => object(HesaMbit\Model\Entity\ApplicantSubject) { | |
'new' => true, | |
'accessible' => [ | |
'*' => true | |
], | |
'properties' => [ | |
'subject_id' => 'amn', | |
'description' => 'Subject 2 description' | |
], | |
'dirty' => [ | |
'subject_id' => true, | |
'description' => true | |
], | |
'original' => [], | |
'virtual' => [], | |
'errors' => [], | |
'repository' => 'ApplicantSubjects' | |
} | |
] | |
], | |
'dirty' => [ | |
'first_name' => true, | |
'surname' => true, | |
'applicant_subjects' => true | |
], | |
'original' => [], | |
'virtual' => [ | |
(int) 0 => 'full_name', | |
(int) 1 => 'formatted_date_of_birth' | |
], | |
'errors' => [], | |
'repository' => 'Applicants' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment