Skip to content

Commit

Permalink
Breadcrumb: items to links
Browse files Browse the repository at this point in the history
  • Loading branch information
zelenin committed Feb 18, 2015
1 parent b2f83d1 commit 91e9c1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions collections/Breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Breadcrumb extends Widget
{
public $items = [];
public $links = [];
public $homeLink;
public $itemOptions = [];
public $encodeLabels = true;
Expand Down Expand Up @@ -40,7 +40,7 @@ public function renderItems()
$items[] = $homelink;
}

foreach ($this->items as $item) {
foreach ($this->links as $item) {
if (!is_array($item)) {
$item = [
'label' => $item
Expand Down
3 changes: 1 addition & 2 deletions modules/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ public function run()
Html::addCssClass($this->options, self::TYPE_FITTED);
}

//$this->options['label'] = null;

echo Html::tag('div', $this->renderInput() . $this->renderLabel(), $this->options);
}

public function renderInput()
{
$this->inputOptions['label'] = null;
return $this->hasModel()
? Html::activeCheckbox($this->model, $this->attribute, $this->inputOptions)
: Html::checkbox($this->name, $this->checked, $this->inputOptions);
Expand Down
4 changes: 3 additions & 1 deletion modules/CheckboxList.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ public function renderInput()
public function getDefaultItem()
{
return function ($index, $label, $name, $checked, $value) {
$inputOptions = $this->inputOptions;
$inputOptions['value'] = ArrayHelper::getValue($inputOptions, 'value', $value);
return Html::tag(
'div',
Checkbox::widget([
'name' => $name,
'label' => $label,
'checked' => $checked,
'inputOptions' => $this->inputOptions,
'inputOptions' => $inputOptions,
'labelOptions' => $this->labelOptions
]),
['class' => 'field']
Expand Down

0 comments on commit 91e9c1a

Please sign in to comment.