### .run()

Runs the widget.

@throws CException if the widget type is invalid.
168611
public function run()
	{
		switch ($this->type) {
			case self::TYPE_CHECKBOX:
				$this->checkBox();
				break;

			case self::TYPE_CHECKBOXLIST:
				$this->checkBoxList();
				break;

			case self::TYPE_CHECKBOXLIST_INLINE:
				$this->checkBoxListInline();
				break;

			case self::TYPE_CHECKBOXGROUPSLIST:
				$this->checkBoxGroupsList();
				break;

			case self::TYPE_DROPDOWN:
				$this->dropDownList();
				break;

			case self::TYPE_FILE:
				$this->fileField();
				break;

			case self::TYPE_PASSWORD:
				$this->passwordField();
				break;

			case self::TYPE_PASSFIELD:
				$this->passfieldField();
				break;

			case self::TYPE_RADIO:
				$this->radioButton();
				break;

			case self::TYPE_RADIOLIST:
				$this->radioButtonList();
				break;

			case self::TYPE_RADIOLIST_INLINE:
				$this->radioButtonListInline();
				break;

			case self::TYPE_RADIOBUTTONGROUPSLIST:
				$this->radioButtonGroupsList();
				break;

			case self::TYPE_TEXTAREA:
				$this->textArea();
				break;

			case 'textfield': // backwards compatibility
			case self::TYPE_TEXT:
				$this->textField();
				break;

			case self::TYPE_MASKEDTEXT:
				$this->maskedTextField();
				break;

			case self::TYPE_CAPTCHA:
				$this->captcha();
				break;

			case self::TYPE_UNEDITABLE:
				$this->uneditableField();
				break;

			case self::TYPE_DATEPICKER:
				$this->datepickerField();
				break;

			case self::TYPE_DATETIMEPICKER:
				$this->datetimepickerField();
				break;

			case self::TYPE_REDACTOR:
				$this->redactorJs();
				break;

			case self::TYPE_MARKDOWNEDITOR:
				$this->markdownEditorJs();
				break;

			case self::TYPE_HTML5EDITOR:
				$this->html5Editor();
				break;

			case self::TYPE_DATERANGEPICKER:
				$this->dateRangeField();
				break;

			case self::TYPE_TOGGLEBUTTON:
				$this->toggleButton();
				break;

			case self::TYPE_COLORPICKER:
				$this->colorpickerField();
				break;

			case self::TYPE_CKEDITOR:
				$this->ckEditor();
				break;

			case self::TYPE_TIMEPICKER:
				$this->timepickerField();
				break;

			case self::TYPE_SELECT2:
				$this->select2Field();
				break;

			case self::TYPE_TYPEAHEAD:
				$this->typeAheadField();
				break;

			case self::TYPE_NUMBER:
				$this->numberField();
				break;

			case self::TYPE_CUSTOM:
				$this->customField();
				break;

			default:
				throw new CException(__CLASS__ . ': Failed to run widget! Type is invalid.');
		}
	}
124537
public function run()
    {
        if (!empty($this->_widgets)) {
            throw new InvalidCallException('Each beginWidget() should have a matching endWidget() call.');
        }
        $id = $this->options['id'];
        $view = $this->getView();
        $options = !empty($this->clientOptions) ? Json::encode($this->clientOptions) : Json::encode([]);
        GridstackAsset::register($view);
        $view->registerJs("jQuery('#$id').gridstack($options);");
        echo self::endContainer($this->tag);
    }
130466
public function run()
	{
		$script = '';
		$script = $script.'KindEditor.ready(function(K){var editor=K.create("textarea[id='.$this->options['id'].']", {'.$this->renderItems($this->items).'})});';
		$this->getView()->registerJs($script);
		KindEditorAsset::register($this->getView());
	}
1302427
public function run()
	{
		parent::run();
		echo $this->render('widget', [
			'id' => $this->getId(),
			'services' => $this->services,
			'action' => $this->action,
			'popup' => $this->popup,
			'assetBundle' => $this->assetBundle,
		]);
	}
1231063
public function run()
    {
        if ($this->mode === self::MODE_BEGIN) {
            echo Html::endTag('div') . "\n";
        } else {
            $options = $this->options;
            $tag = ArrayHelper::remove($options, 'tag', 'ul');
            echo Html::beginTag($tag, $options) . "\n";
            echo $this->renderItems() . "\n";
            echo Html::endTag($tag) . "\n";
        }
        
        $this->registerWidget('selectable');
    }
90091
public function run()
    {
        if (!empty($this->_fields)) {
            throw new InvalidCallException('Each beginField() should have a matching endField() call.');
        }

        if ($this->enableClientScript) {
            $id = $this->options['id'];
            $options = Json::htmlEncode($this->getClientOptions());
            $attributes = Json::htmlEncode($this->attributes);
            $view = $this->getView();
            ActiveFormAsset::register($view);
            $view->registerJs("jQuery('#$id').yiiActiveForm($attributes, $options);");
        }

        echo Html::endForm();
    }
355922
public function run() {
		list($name, $id) = $this->resolveNameID();

		if (isset($this->htmlOptions['id'])) {
			$id = $this->htmlOptions['id'];
		} else {
			$this->htmlOptions['id'] = $id;
		}

		if (isset($this->htmlOptions['name'])) {
			$name = $this->htmlOptions['name'];
		}

		if ($this->hasModel()) {
			echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
		} else {
			echo CHtml::textField($name, $this->value, $this->htmlOptions);
		}

		if (isset($this->datasets['source']))
			$this->datasets = array($this->datasets);

		$datasets_js = array();
		foreach ($this->datasets as $i => $dataset) {
			if (!isset($dataset['source'])) {
				throw new CException('The source for a Typeahead dataset was not set');
			}
			if (isset($dataset['source']['name'])) {
				$name = preg_replace('/[^\da-z]/i', '_', $dataset['source']['name']);
				$bloodhound_id = $this->id .'_bloodhound_'. $name;
				$dataset['source'] = 'js:'. $bloodhound_id .'.ttAdapter()';
			} else {
				$dataset['source'] = 'js:substringMatcher(_'. $this->id .'_source_list_'. $i .')';
			}
			$this->datasets[$i] = $dataset;
			$datasets_js[] = CJavaScript::encode($dataset);
		}
		
		$options = CJavaScript::encode($this->options);
		$datasets = implode(', ', $datasets_js);
		
		Yii::app()->clientScript->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').typeahead({$options}, {$datasets});");
		
	}
31105
public function run()
	{
		$id = $this->htmlOptions['id'];

		echo CHtml::openTag('div', $this->htmlOptions);

		foreach ($this->alerts as $type => $alert)
		{
			if (is_string($alert))
			{
				$type = $alert;
				$alert = array();
			}

			if (isset($alert['visible']) && $alert['visible'] === false)
				continue;

			if (Yii::app()->user->hasFlash($type))
			{
				$classes = array('alert in');

				if (!isset($alert['block']))
					$alert['block'] = $this->block;

				if ($alert['block'] === true)
					$classes[] = 'alert-block';

				if (!isset($alert['fade']))
					$alert['fade'] = $this->fade;

				if ($alert['fade'] === true)
					$classes[] = 'fade';

				$validTypes = array(self::TYPE_SUCCESS, self::TYPE_INFO, self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_DANGER);

				if (in_array($type, $validTypes))
					$classes[] = 'alert-'.$type;

				if (!isset($alert['htmlOptions']))
					$alert['htmlOptions'] = array();

				$classes = implode(' ', $classes);
				if (isset($alert['htmlOptions']['class']))
					$alert['htmlOptions']['class'] .= ' '.$classes;
				else
					$alert['htmlOptions']['class'] = $classes;

				echo CHtml::openTag('div', $alert['htmlOptions']);

				if ($this->closeText !== false && !isset($alert['closeText']))
					$alert['closeText'] = $this->closeText;
				else
					$alert['closeText'] = false;

				if (isset($alert['closeText']) && $alert['closeText'] !== false)
					echo '<a class="close" data-dismiss="alert">'.$alert['closeText'].'</a>';

				echo Yii::app()->user->getFlash($type);

				echo '</div>';
			}
		}

		echo '</div>';

		$selector = "#{$id} .alert";
		$id .= '_'.self::$_containerId++;

		/** @var CClientScript $cs */
		$cs = Yii::app()->getClientScript();
		//$cs->registerScript(__CLASS__.'#'.$id, "jQuery('{$selector}').alert();");

		foreach ($this->events as $name => $handler)
		{
			$handler = CJavaScript::encode($handler);
			$cs->registerScript(__CLASS__.'#'.$id.'_'.$name, "jQuery('{$selector}').on('{$name}', {$handler});");
		}
	}
564148
public function run() {
		
		$id = $this->htmlOptions['id'];

		echo CHtml::openTag('div', $this->htmlOptions);

		foreach ($this->alerts as $type => $alert) {

			if (is_string($alert)) {
				$type = $alert;
				$alert = array();
			}

			if (isset($alert['visible']) && $alert['visible'] === false) {
				continue;
			}

			/** @var CWebUser $userComponent */
			$userComponent = Yii::app()->getComponent($this->userComponentId);
			if (!$userComponent->hasFlash($type))
				continue;

			$alertText = $userComponent->getFlash($type);
            if (empty($alertText)) { // null, ''
                continue;
            }

			$this->renderSingleAlert($alert, $type, $alertText);
		}

		echo CHtml::closeTag('div');

		$id .= '_' . self::$_containerId++;
		$selector = "#{$id} .alert";

		/** @var CClientScript $cs */
		$cs = Yii::app()->getClientScript();
		$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('{$selector}').alert();");

		foreach ($this->events as $name => $handler) {
			$handler = CJavaScript::encode($handler);
			$cs->registerScript(
				__CLASS__ . '#' . $id . '_' . $name,
				"jQuery('{$selector}').on('{$name}', {$handler});"
			);
		}
	}
229390
public function run()
    {
        $classes = $this->generateClass();
        
        echo Html::beginTag('div', ['class' => $classes])."\n";
        echo $this->renderItems()."\n";
        echo Html::endTag('div')."\n";
    }
350634
public function run() {
		
		echo CHtml::openTag('div', $this->htmlOptions);
		if (empty($this->stacked)) {
			echo '<div class="'.implode(' ', $this->progressBarClasses).'" style="width: ' . $this->percent . '%;">' . $this->content . '</div>';
		} elseif (is_array($this->stacked)) {
			foreach ($this->stacked as $bar) {
				$options = isset($bar['htmlOptions']) ? $bar['htmlOptions'] : array();
				if (empty($options['style'])) {
					$options['style'] = '';
				} else {
					$options['style'] .= ' ';
				}
				$options['style'] .= 'width: ' . $bar['percent'] . '%';

				if (empty($options['class'])) {
					$options['class'] = '';
				} else {
					$options['style'] .= ' ';
				}
				$options['class'] .= 'progress-bar progress-bar-' . $bar['context'];

				echo '<div ' . CHtml::renderAttributes($options) . '>' . @$bar['content'] . '</div>';
			}
		}
		echo CHtml::closeTag('div');
	}
667438
public function run()
    {
        if (($flashMessages = Yii::$app->session->getAllFlashes())) {
            echo '<div class="flashes">';
            foreach ($flashMessages as $key => $messages) {
                $cssClasses = 'alert alert-'.(isset($this->_map[$key]) ? $this->_map[$key] : $key);
                if (!is_array($messages)) {
                    $messages = [$messages];
                }
                foreach ($messages as $message) {
                    echo '<div class="'.$cssClasses.'">'.$message.'</div>';
                }
            }
            echo '</div>';
        }
    }
753938
public function run()
	{
		$id=$this->getId();
		if(isset($this->htmlOptions['id']))
			$id=$this->htmlOptions['id'];
		else
			$this->htmlOptions['id']=$id;

		$options=CJavaScript::encode($this->options);
		Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}').sortable({$options});");

		echo CHtml::openTag($this->tagName,$this->htmlOptions)."\n";
		foreach($this->items as $id=>$content)
			echo strtr($this->itemTemplate,array('{id}'=>$id,'{content}'=>$content))."\n";
		echo CHtml::closeTag($this->tagName);
	}
991913
public function run()
    {
        if (empty($this->items)) {
            return;
        }
        if (!isset($this->containerOptions['id'])) {
            $this->containerOptions['id'] = $this->getId();
        }
        echo $this->renderItems() . "\n";
        $this->registerAssets();
    }
719007
public function run()
    {
        echo $this->renderWidget() . "\n";

        $containerID = $this->inline ? $this->containerOptions['id'] : $this->options['id'];
        $language = $this->language ? $this->language : Yii::$app->language;

        if (strncmp($this->dateFormat, 'php:', 4) === 0) {
            $this->clientOptions['dateFormat'] = FormatConverter::convertDatePhpToJui(substr($this->dateFormat, 4));
        } else {
            $this->clientOptions['dateFormat'] = FormatConverter::convertDateIcuToJui($this->dateFormat, 'date', $language);
        }

        if ($language !== 'en-US') {
            $view = $this->getView();
            $assetBundle = DatePickerLanguageAsset::register($view);
            $assetBundle->language = $language;
            $options = Json::htmlEncode($this->clientOptions);
            $language = Html::encode($language);
            $view->registerJs("jQuery('#{$containerID}').datepicker($.extend({}, $.datepicker.regional['{$language}'], $options));");
        } else {
            $this->registerClientOptions('datepicker', $containerID);
        }

        $this->registerClientEvents('datepicker', $containerID);
        JuiAsset::register($this->getView());
    }
1153352
public function run()
    {
        list($name, $id) = $this->resolveNameID();
        $this->resolveId($id);

        if ($this->hasModel()) {
            $input = TbHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions);
        } else {
            $input = TbHtml::fileField($name, $this->value, $this->htmlOptions);
        }

        echo TbHtml::tag('span', $this->buttonOptions, $this->label . ' ' . $input);

        if ($this->assetPath !== false) {
            $this->publishAssets($this->assetPath);
            $this->registerCssFile('css/jquery.fileupload-ui.css');

            if ($this->registerJs) {
                $this->getClientScript()->registerCoreScript('jquery');
                $this->registerScriptFile('js/vendor/jquery.ui.widget.js', CClientScript::POS_END);
                $this->registerScriptFile('js/jquery.iframe-transport.js', CClientScript::POS_END);
                $this->registerScriptFile('js/jquery.fileupload.js', CClientScript::POS_END);
            }
        }

        if ($this->bindPlugin) {
            TbArray::defaultValue('dataType', 'json', $this->pluginOptions);
            $options = !empty($this->pluginOptions) ? CJavaScript::encode($this->pluginOptions) : '';
            $script = <<<EOD
jQuery('#{$id}')
    .fileupload({$options})
    .prop('disabled', !jQuery.support.fileInput)
    .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
EOD;
            $this->getClientScript()->registerScript(__CLASS__ . '#' . $id, $script);
        }
    }
390813
public function run()
    {
        echo "\n" . $this->renderBodyEnd();
        echo "\n" . $this->renderFooter();
        echo "\n" . Html::endTag('div'); // modal-content
        echo "\n" . Html::endTag('div'); // modal-dialog
        echo "\n" . Html::endTag('div');

        $this->registerPlugin('modal');
    }