Created
February 27, 2016 14:20
-
-
Save cakephp-tutorial/cbd0d179d1123b0d1469 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 | |
# /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