Commit affa9589 by Kartik Visweswaran

CSS Class assignment corrected.

Used ```Html::addCssClass``` and ```Html::removeCssClass``` more effectively.
parent 70f41387
...@@ -44,12 +44,13 @@ class Alert extends Widget ...@@ -44,12 +44,13 @@ class Alert extends Widget
foreach ($flashes as $type => $message) { foreach ($flashes as $type => $message) {
if (in_array($type, $this->allowedTypes)) { if (in_array($type, $this->allowedTypes)) {
$class = ($type === 'error') ? 'alert-danger' : 'alert-' . $type; $class = ($type === 'error') ? 'alert-danger' : 'alert-' . $type;
$this->options['class'] = $class; Html::addCssClass($this->options, $class);
echo BsAlert::widget([ echo BsAlert::widget([
'body' => $message, 'body' => $message,
'closeButton' => $this->closeButton, 'closeButton' => $this->closeButton,
'options' => $this->options 'options' => $this->options
]); ]);
Html::removeCssClass($this->options, $class);
$session->removeFlash($type); $session->removeFlash($type);
$this->_doNotRender = false; $this->_doNotRender = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment