Commit 914608ae authored by Sam's avatar Sam

Fixed widgets using echo in their run. #7417

parent 0bbace38
...@@ -56,7 +56,7 @@ class Button extends Widget ...@@ -56,7 +56,7 @@ class Button extends Widget
*/ */
public function run() public function run()
{ {
echo Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
$this->registerPlugin('button'); $this->registerPlugin('button');
return Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
} }
} }
...@@ -79,11 +79,13 @@ class ButtonDropdown extends Widget ...@@ -79,11 +79,13 @@ class ButtonDropdown extends Widget
$options = $this->containerOptions; $options = $this->containerOptions;
$tag = ArrayHelper::remove($options, 'tag', 'div'); $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'); $this->registerPlugin('button');
return implode("\n", [
Html::beginTag($tag, $this->containerOptions),
$this->renderButton(),
$this->renderDropdown(),
Html::endTag($tag)
]);
} }
/** /**
......
...@@ -67,8 +67,8 @@ class ButtonGroup extends Widget ...@@ -67,8 +67,8 @@ class ButtonGroup extends Widget
*/ */
public function run() public function run()
{ {
echo Html::tag('div', $this->renderButtons(), $this->options);
BootstrapAsset::register($this->getView()); BootstrapAsset::register($this->getView());
return Html::tag('div', $this->renderButtons(), $this->options);
} }
/** /**
......
...@@ -81,12 +81,14 @@ class Carousel extends Widget ...@@ -81,12 +81,14 @@ class Carousel extends Widget
*/ */
public function run() 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'); $this->registerPlugin('carousel');
return implode("\n", [
Html::beginTag('div', $this->options),
$this->renderIndicators(),
$this->renderItems(),
$this->renderControls(),
Html::endTag('div')
]);
} }
/** /**
......
...@@ -76,10 +76,12 @@ class Collapse extends Widget ...@@ -76,10 +76,12 @@ class Collapse extends Widget
*/ */
public function run() public function run()
{ {
echo Html::beginTag('div', $this->options) . "\n";
echo $this->renderItems() . "\n";
echo Html::endTag('div') . "\n";
$this->registerPlugin('collapse'); $this->registerPlugin('collapse');
return implode("\n", [
Html::beginTag('div', $this->options),
$this->renderItems(),
Html::endTag('div')
]);
} }
/** /**
......
...@@ -73,9 +73,9 @@ class Dropdown extends Widget ...@@ -73,9 +73,9 @@ class Dropdown extends Widget
*/ */
public function run() public function run()
{ {
echo $this->renderItems($this->items, $this->options);
BootstrapPluginAsset::register($this->getView()); BootstrapPluginAsset::register($this->getView());
$this->registerClientEvents(); $this->registerClientEvents();
return $this->renderItems($this->items, $this->options);
} }
/** /**
......
...@@ -115,8 +115,8 @@ class Nav extends Widget ...@@ -115,8 +115,8 @@ class Nav extends Widget
*/ */
public function run() public function run()
{ {
echo $this->renderItems();
BootstrapAsset::register($this->getView()); BootstrapAsset::register($this->getView());
return $this->renderItems();
} }
/** /**
......
...@@ -105,10 +105,12 @@ class Progress extends Widget ...@@ -105,10 +105,12 @@ class Progress extends Widget
*/ */
public function run() public function run()
{ {
echo Html::beginTag('div', $this->options) . "\n";
echo $this->renderProgress() . "\n";
echo Html::endTag('div') . "\n";
BootstrapAsset::register($this->getView()); BootstrapAsset::register($this->getView());
return implode("\n", [
Html::beginTag('div', $this->options),
$this->renderProgress(),
Html::endTag('div')
]);
} }
/** /**
......
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