public function add($product_id = null) {
if ($this->request->is('POST')) {
$this->Version->create();
- $this->Version->value('value', $_POST['value']);
- $this->Version->value('nature', $_POST['nature']);
- $this->Version->value('product', $_POST['product']);
+ $this->Version->value('value', $this->request->data['Version']['value']);
+ $this->Version->value('nature', $this->request->data['Version']['nature']);
+ $this->Version->value('product', $this->request->data['Version']['product']);
if ($this->Version->save($this->request->data)) {
$this->Session->setFlash(__("La version a été enregistrée."));
$this->redirect(array('action' => 'index'));