Commit 4fccdc2a by Crisu83

refactored some code in BootNavbar

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