Browse Source

Fixed widgets using echo in their run. #7417

tags/2.0.3
Sam 10 years ago
parent
commit
914608aedf
  1. 2
      Button.php
  2. 10
      ButtonDropdown.php
  3. 2
      ButtonGroup.php
  4. 12
      Carousel.php
  5. 8
      Collapse.php
  6. 2
      Dropdown.php
  7. 2
      Nav.php
  8. 8
      Progress.php

2
Button.php

@ -56,7 +56,7 @@ class Button extends Widget
*/
public function run()
{
echo Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
$this->registerPlugin('button');
return Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
}
}

10
ButtonDropdown.php

@ -79,11 +79,13 @@ class ButtonDropdown extends Widget
$options = $this->containerOptions;
$tag = ArrayHelper::remove($options, 'tag', 'div');
echo Html::beginTag($tag, $this->containerOptions);
echo "\n" . $this->renderButton();
echo "\n" . $this->renderDropdown();
echo "\n" . Html::endTag($tag);
$this->registerPlugin('button');
return implode("\n", [
Html::beginTag($tag, $this->containerOptions),
$this->renderButton(),
$this->renderDropdown(),
Html::endTag($tag)
]);
}
/**

2
ButtonGroup.php

@ -67,8 +67,8 @@ class ButtonGroup extends Widget
*/
public function run()
{
echo Html::tag('div', $this->renderButtons(), $this->options);
BootstrapAsset::register($this->getView());
return Html::tag('div', $this->renderButtons(), $this->options);
}
/**

12
Carousel.php

@ -81,12 +81,14 @@ class Carousel extends Widget
*/
public function run()
{
echo Html::beginTag('div', $this->options) . "\n";
echo $this->renderIndicators() . "\n";
echo $this->renderItems() . "\n";
echo $this->renderControls() . "\n";
echo Html::endTag('div') . "\n";
$this->registerPlugin('carousel');
return implode("\n", [
Html::beginTag('div', $this->options),
$this->renderIndicators(),
$this->renderItems(),
$this->renderControls(),
Html::endTag('div')
]);
}
/**

8
Collapse.php

@ -76,10 +76,12 @@ class Collapse extends Widget
*/
public function run()
{
echo Html::beginTag('div', $this->options) . "\n";
echo $this->renderItems() . "\n";
echo Html::endTag('div') . "\n";
$this->registerPlugin('collapse');
return implode("\n", [
Html::beginTag('div', $this->options),
$this->renderItems(),
Html::endTag('div')
]);
}
/**

2
Dropdown.php

@ -73,9 +73,9 @@ class Dropdown extends Widget
*/
public function run()
{
echo $this->renderItems($this->items, $this->options);
BootstrapPluginAsset::register($this->getView());
$this->registerClientEvents();
return $this->renderItems($this->items, $this->options);
}
/**

2
Nav.php

@ -115,8 +115,8 @@ class Nav extends Widget
*/
public function run()
{
echo $this->renderItems();
BootstrapAsset::register($this->getView());
return $this->renderItems();
}
/**

8
Progress.php

@ -105,10 +105,12 @@ class Progress extends Widget
*/
public function run()
{
echo Html::beginTag('div', $this->options) . "\n";
echo $this->renderProgress() . "\n";
echo Html::endTag('div') . "\n";
BootstrapAsset::register($this->getView());
return implode("\n", [
Html::beginTag('div', $this->options),
$this->renderProgress(),
Html::endTag('div')
]);
}
/**

Loading…
Cancel
Save