diff --git a/Controller/BoostCakeController.php b/Controller/BoostCakeController.php index ea09f06..0513481 100644 --- a/Controller/BoostCakeController.php +++ b/Controller/BoostCakeController.php @@ -40,14 +40,14 @@ public function index() { * @return void */ public function bootstrap2() { - $this->Session->setFlash(__('Alert notice message testing...'), 'alert', array( + $this->Flash->alert(__('Alert notice message testing...'), 'alert', array( 'plugin' => 'BoostCake', ), 'notice'); - $this->Session->setFlash(__('Alert success message testing...'), 'alert', array( + $this->Flash->alert(__('Alert success message testing...'), 'alert', array( 'plugin' => 'BoostCake', - 'class' => 'alert-success' + 'params' => ['class' => 'alert-success'] ), 'success'); - $this->Session->setFlash(__('Alert error message testing...'), 'alert', array( + $this->Flash->alert(__('Alert error message testing...'), 'alert', array( 'plugin' => 'BoostCake', 'class' => 'alert-error' ), 'error'); @@ -59,19 +59,19 @@ public function bootstrap2() { * @return void */ public function bootstrap3() { - $this->Session->setFlash(__('Alert success message testing...'), 'alert', array( + $this->Flash->alert(__('Alert success message testing...'), 'alert', array( 'plugin' => 'BoostCake', - 'class' => 'alert-success' + 'params' => ['class' => 'alert-success'] ), 'success'); - $this->Session->setFlash(__('Alert info message testing...'), 'alert', array( + $this->Flash->alert(__('Alert info message testing...'), 'alert', array( 'plugin' => 'BoostCake', 'class' => 'alert-info' ), 'info'); - $this->Session->setFlash(__('Alert warning message testing...'), 'alert', array( + $this->Flash->alert(__('Alert warning message testing...'), 'alert', array( 'plugin' => 'BoostCake', - 'class' => 'alert-warning' + 'params' => ['class' => 'alert-danger'], ), 'warning'); - $this->Session->setFlash(__('Alert danger message testing...'), 'alert', array( + $this->Flash->alert(__('Alert danger message testing...'), 'alert', array( 'plugin' => 'BoostCake', 'class' => 'alert-danger' ), 'danger'); diff --git a/View/Elements/Flash/alert.ctp b/View/Elements/Flash/alert.ctp new file mode 100644 index 0000000..af009a6 --- /dev/null +++ b/View/Elements/Flash/alert.ctp @@ -0,0 +1,17 @@ + +
+ + × + + +
\ No newline at end of file diff --git a/View/Elements/alert.ctp b/View/Elements/alert.ctp deleted file mode 100644 index 1830935..0000000 --- a/View/Elements/alert.ctp +++ /dev/null @@ -1,14 +0,0 @@ - -
- - × - - -
\ No newline at end of file diff --git a/View/Elements/alert.ctp b/View/Elements/alert.ctp new file mode 120000 index 0000000..b141ba6 --- /dev/null +++ b/View/Elements/alert.ctp @@ -0,0 +1 @@ +Flash/alert.ctp \ No newline at end of file diff --git a/View/Elements/bootstrap2/alerts.ctp b/View/Elements/bootstrap2/alerts.ctp index b814980..ba3bd9a 100644 --- a/View/Elements/bootstrap2/alerts.ctp +++ b/View/Elements/bootstrap2/alerts.ctp @@ -3,16 +3,16 @@ echo $this->Session->flash(); // Controller -$this->Session->setFlash(__('Alert notice message testing...'), 'alert', array( +$this->Flash->alert(__('Alert notice message testing...'), 'alert', array( 'plugin' => 'BoostCake', )); -$this->Session->setFlash(__('Alert success message testing...'), 'alert', array( +$this->Flash->alert(__('Alert success message testing...'), 'alert', array( 'plugin' => 'BoostCake', - 'class' => 'alert-success' + 'params' => ['class' => 'alert-success'] )); -$this->Session->setFlash(__('Alert error message testing...'), 'alert', array( +$this->Flash->alert(__('Alert error message testing...'), 'alert', array( 'plugin' => 'BoostCake', 'class' => 'alert-error' )); diff --git a/View/Elements/bootstrap3/alerts.ctp b/View/Elements/bootstrap3/alerts.ctp index 247145c..ac7d9c0 100644 --- a/View/Elements/bootstrap3/alerts.ctp +++ b/View/Elements/bootstrap3/alerts.ctp @@ -3,22 +3,22 @@ echo $this->Session->flash(); // Controller -$this->Session->setFlash(__('Alert success message testing...'), 'alert', array( +$this->Flash->alert(__('Alert success message testing...'), 'alert', array( 'plugin' => 'BoostCake', - 'class' => 'alert-success' + 'params' => ['class' => 'alert-success'] )); -$this->Session->setFlash(__('Alert info message testing...'), 'alert', array( +$this->Flash->alert(__('Alert info message testing...'), 'alert', array( 'plugin' => 'BoostCake', 'class' => 'alert-info' )); -$this->Session->setFlash(__('Alert warning message testing...'), 'alert', array( +$this->Flash->alert(__('Alert warning message testing...'), 'alert', array( 'plugin' => 'BoostCake', - 'class' => 'alert-warning' + 'params' => ['class' => 'alert-danger'], )); -$this->Session->setFlash(__('Alert danger message testing...'), 'alert', array( +$this->Flash->alert(__('Alert danger message testing...'), 'alert', array( 'plugin' => 'BoostCake', 'class' => 'alert-danger' ));