Created
October 6, 2014 06:35
-
-
Save dakota/a6d1a83ababb615c151d 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->input('Tsystem.id', array('options' => $tsystems)); | |
echo $this->Form->input('licence_plate'); | |
echo $this->Form->input('vin'); |
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 | |
//Add method | |
public function add() { | |
if ($this->request->is('post')) { | |
$this->Truck->create(); | |
if ($this->Truck->saveAssociated($this->request->data)) { | |
$this->Session->setFlash(__('The truck has been saved.')); | |
return $this->redirect(array('action' => 'index')); | |
} else { | |
$this->Session->setFlash(__('The truck could not be saved. Please, try again.')); | |
} | |
} | |
$this->set('tsystems', $this->Truck->Tsystem->find('list')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment