Skip to content

Commit

Permalink
fixed setting active for BootBreadcrumbs::homeLink
Browse files Browse the repository at this point in the history
  • Loading branch information
Crisu83 committed Apr 28, 2012
1 parent f61ba42 commit d894807
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions widgets/BootBreadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,17 @@ public function init()
*/
public function run()
{
if (empty($this->links))
return;

$links = array();

if ($this->homeLink === null)
if (!isset($this->homeLink))
$this->homeLink = array('label'=>Yii::t('bootstrap', 'Home'), 'url'=>Yii::app()->homeUrl);

if ($this->homeLink !== false)
{
if (is_array($this->homeLink))
$this->homeLink = CHtml::link($this->homeLink['label'], $this->homeLink['url']);

$links[] = $this->renderItem($this->homeLink);
$links[] = $this->renderItem($this->homeLink, Yii::app()->request->requestUri === Yii::app()->homeUrl);
}

foreach ($this->links as $label=>$url)
Expand Down

0 comments on commit d894807

Please sign in to comment.