Commit 4fccdc2a by Crisu83

refactored some code in BootNavbar

parent f2f79cb5
......@@ -67,14 +67,15 @@ class BootNavbar extends CWidget
if (!isset($this->brandUrl))
$this->brandUrl = Yii::app()->homeUrl;
}
$this->brandOptions['href'] = $this->brandUrl;
if (isset($this->brandOptions['class']))
$this->brandOptions['class'] .= ' brand';
else
$this->brandOptions['class'] = 'brand';
}
/**
* Runs the widget.
*/
public function run()
{
$classes = array('navbar');
if ($this->fixed !== false)
......@@ -89,15 +90,13 @@ class BootNavbar extends CWidget
$this->htmlOptions['class'] .= ' '.$classes;
else
$this->htmlOptions['class'] = $classes;
}
if (isset($this->brandOptions['class']))
$this->brandOptions['class'] .= ' brand';
else
$this->brandOptions['class'] = 'brand';
if (isset($this->brandUrl))
$this->brandOptions['href'] = $this->brandUrl;
/**
* Runs the widget.
*/
public function run()
{
$containerCssClass = $this->fluid ? 'container-fluid' : 'container';
echo CHtml::openTag('div', $this->htmlOptions);
......
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