1
0

Info controller add method

This commit is contained in:
Anthony Gourd
2015-12-04 02:03:36 +01:00
parent 6ef80f26bd
commit 330e22e9fc
2 changed files with 7 additions and 5 deletions
src
Controller
Template

@ -50,10 +50,14 @@ class InfosController extends AppController
*
* @return void Redirects on successful add, renders view otherwise.
*/
public function add()
public function add($crisis_id)
{
$user_id = $this->Auth->user()['id'];
$info = $this->Infos->newEntity();
if ($this->request->is('post')) {
if ($this->request->is('post'))
{
$info->crisis_id = $crisis_id;
$info->user_id = $user_id;
$info = $this->Infos->patchEntity($info, $this->request->data);
if ($this->Infos->save($info)) {
$this->Flash->success(__('L\'Information a bien été enregistrée.'));

@ -115,12 +115,10 @@
<?= $this->Html->script("foundation/foundation.js") ?>
<?= $this->Html->script("foundation/foundation.alert.js") ?>
<?= $this->Html->script("foundation/foundation.topbar.js") ?>
<<<<<<< HEAD
<!--<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<script>tinymce.init({ selector:'textarea' });</script>-->
=======
>>>>>>> 2b605011828f0c48b089640254e57e75b5330786
<!-- Own script -->
<!-- Topbar -->
<?= $this->Html->script('foundation/foundation.offcanvas.js') ?>