Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 27, 2016 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cakephp-tutorial/cbd0d179d1123b0d1469 to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/cbd0d179d1123b0d1469 to your computer and use it in GitHub Desktop.
<?php
# /app/Controller/OrdersController.php
class OrdersController extends AppController {
public function add() {
if ($this->request->is(array('post', 'put')) {
$this->Order->create();
if ($this->Order->saveAll($this->request->data, array('deep' => true)) {
$this->Session->setFlash('Ordine creato con successo');
//$this->redirect(array('action' => 'view', $this->Order->id);
}
}
$regions = $this->Order->Region->find('list');
$this->set(compact('regions'));
}
/*
* @todo Da fare
*/
public function view($id = null) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment