Skip to content

Instantly share code, notes, and snippets.

@dakota
Created October 6, 2014 06:35
Show Gist options
  • Save dakota/a6d1a83ababb615c151d to your computer and use it in GitHub Desktop.
Save dakota/a6d1a83ababb615c151d to your computer and use it in GitHub Desktop.
<?php
echo $this->Form->input('Tsystem.id', array('options' => $tsystems));
echo $this->Form->input('licence_plate');
echo $this->Form->input('vin');
<?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