Renders an icon.

@return string the rendered icon
@throws \yii\base\InvalidConfigException if icon name is not specified

@uses http://www.yiiframework.com/doc-2.0/yii-helpers-basearrayhelper.html#getValue()-detail
@see Icon::run
495734
protected function renderIcon()
    {
        if (!$this->icon) {
            return '';
        }

        return Icon::widget([
            'name' => ArrayHelper::getValue($this->icon, 'name', null),
            'position' => ArrayHelper::getValue($this->icon, 'position', null),
            'options' => ArrayHelper::getValue($this->icon, 'options', [])
        ]);
    }
680910
public function render(Icon $icon)
    {
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[url]', $icon->getUrl());

        if ($icon->hasAnchor()) {
            $jsonBuilder->setValue('[anchor]', $icon->getAnchor()->getVariable(), false);
        }

        if ($icon->hasOrigin()) {
            $jsonBuilder->setValue('[origin]', $icon->getOrigin()->getVariable(), false);
        }

        if ($icon->hasScaledSize()) {
            $jsonBuilder->setValue('[scaledSize]', $icon->getScaledSize()->getVariable(), false);
        }

        if ($icon->hasSize()) {
            $jsonBuilder->setValue('[size]', $icon->getScaledSize()->getVariable(), false);
        }

        return $this->getFormatter()->renderObjectAssignment($icon, $jsonBuilder->build());
    }
1275496
public function run() {

		$this->options[ 'directory' ]	= $this->directory;
		$this->options[ 'type' ]		= $this->type;

		return $this->renderWidget();
	}
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());
    }
929378
public function render()
	{
		switch ($this->getContext()) {
			case BaseField::CONTEXT_LIST:
				$values = [];
				foreach ($this->getValue() as $item) {
					$values[] = $item->{$this->getDisplayField()};
				}

				return implode(', ', $values);

				break;
			case BaseField::CONTEXT_FORM:

				$baseModel  = $this->getAdmin()->getModel();
				$baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

				$relatedModel = $baseModel->{$this->getName()}()->getRelated();
				$relatedModel = get_class($relatedModel);

				$items = [];
				foreach ($relatedModel::all() as $item) {
					$items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
				}

				$id = $this->getAdmin()->getFormBuilder()->getIdentifier();

				$values = [];
				foreach ($relatedModel::where(Str::singular($baseModel->getTable()) . '_id', $id)->get() as $item) {
					$values[] = (string) $item->{$primaryKey};
				}

				return View::make('krafthaus/bauhaus::models.fields._has_many')
					->with('field',  $this)
					->with('items',  $items)
					->with('values', $values);

				break;
		}
	}
301527
public function run()
    {
        if ($this->toggleButtonOptions !== false) {
            $html[] = $this->renderToggleButton();
        }
        $html[] = $this->renderItems($this->items, $this->options);
        return implode("\n", $html);
    }
124120
function render()
    {
        $label = $this->getLabel();
        if ( empty($label) )
            throw new \Exception('Header label is empty.');

        return $label.': '.$this->renderValueLine().self::CRLF;
    }
490581
public function render()
    {
        if (!is_resource($this->image)) {
            throw new \RuntimeException(
                'Attempt to render invalid resource as image.'
            );
        }

        header('Content-type: image/png');
        imagepng($this->image, null, 9, PNG_ALL_FILTERS);

        return $this;
    }
681840
public function render()
	{
		$attributes	= $this->getAttributes();
		if( empty( $this->url ) )
			throw new InvalidArgumentException( 'Image URL is empty' );
		$attributes['title']	= (string) $this->title;
		$attributes['alt'] 		= (string) $this->title;
		$attributes['src'] 		= $this->url;
		return UI_HTML_Tag::create( 'img', NULL, $attributes );
	}
17588
public function run()
    {
        MaterializeAsset::register($this->getView());
        return Html::tag(
            'div',
            Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options) . Html::tag('ul', $this->renderButtons()),
            $this->wrapOptions
        );
    }
728427
public function getIcon()
    {
        $data = ArrayData::create([]);

        $iconClass = $this->config()->get('icon');
        if ($iconClass) {
            $data->IconClass = $iconClass;

            // Add versioned states (rendered as a circle over the icon)
            if ($this->hasExtension(Versioned::class)) {
                $data->IsVersioned = true;
                if ($this->isOnDraftOnly()) {
                    $data->VersionState = 'draft';
                    $data->VersionStateTitle = _t(
                        'SilverStripe\\Versioned\\VersionedGridFieldState\\VersionedGridFieldState.ADDEDTODRAFTHELP',
                        'Item has not been published yet'
                    );
                } elseif ($this->isModifiedOnDraft()) {
                    $data->VersionState = 'modified';
                    $data->VersionStateTitle = $data->VersionStateTitle = _t(
                        'SilverStripe\\Versioned\\VersionedGridFieldState\\VersionedGridFieldState.MODIFIEDONDRAFTHELP',
                        'Item has unpublished changes'
                    );
                }
            }

            return $data->renderWith(__CLASS__ . '/PreviewIcon');
        }

        return null;
    }
255866
private function renderItems()
    {
        $items = [];
        $icons = $this->icons['items'];
        foreach($icons as $i){
            $labelContent = $i['label'];
            if ($this->encodeLabel) {
                $labelContent = Html::encode($labelContent);
            }
            $label = Html::tag('label',$labelContent)."\n";
            
            $icon = Html::tag('i','',['class'=>$i['icon']])."\n";
            
            $options = ArrayHelper::getValue($i, 'options', []);
            
            if(isset($options['class'])){
                $addClass = 'item '.$options['class'];
                $options = [
                    'class' => $addClass,
                ];
            }else{
                $options['class'] = 'item';
            }
            
            $url = $i['url'];
            $items[] = Html::a($icon.$label,$url,$options)."\n";
        }
        return implode("\n", $items);
    }
1253180
public function render()
    {
        $htmlContent = '';
        foreach (self::$iconList->toArray() as $icon) {
            $htmlContent .= '<link href="' . $icon[0] . '" rel="icon">' . PHP_EOL;
        }
        return $htmlContent;
    }
148741
private function render() : string
    {
        $styles = $this->styles();
        if (strlen($styles) > 0) {
            $styles = 'style="' . $this->view->escapeHtmlAttr(trim($styles)) . '"';
        }

        return '
            <div class="progress">
                <div class="progress-bar' . $this->classes() . '" role="progressbar" ' . $styles .
            ' aria-valuenow="' . $this->value . '" aria-valuemin="0" aria-valuemax="100">' .
            (($this->label !== null) ? $this->view->escapeHtml($this->label) : null) . '</div>
            </div>';
    }
1047974
private function renderWidget()
    {
        $img = $this->getImageSource();

        echo "<div>$img</div>";

        if ($this->link || is_string($this->link)) {
            echo Html::a($this->link, $this->otp->getProvisioningUri());
        }

        if ($this->hasModel()
            && $this->model->hasProperty($this->attribute)
            && empty($this->model->{$this->attribute})
        ) {
            $this->model->setAttributes([$this->attribute => $this->otp->getSecret()]);
        }
        echo Html::activeHiddenInput($this->model, $this->attribute, $this->options);
    }
639890
public function render()
	{
		if ($this->getDisplayField() === null) {
			throw new \InvalidArgumentException(sprintf('Please provide a display field for the `%s` relation via the display(); method.', $this->getName()));
		}

		switch ($this->getContext()) {
			case BaseField::CONTEXT_LIST:
				$value = $this->getValue();
				return $value->{$this->getDisplayField()};
				break;

			case BaseField::CONTEXT_FILTER:
                $baseModel  = $this->getAdmin()->getModel();
                $baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

                $relatedModel = $baseModel->{$this->getName()}()->getRelated();

                $items = [];
                foreach ($relatedModel::all() as $item) {
                    $items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
                }

                $column = Str::singular($relatedModel->getTable()) . '_id';
                if (Input::has($column)) {
                    $this->setValue(Input::get($column));
                }

				return View::make('krafthaus/bauhaus::models.fields._belongs_to')
					->with('field', $this)
					->with('items', $items);
				break;

			case BaseField::CONTEXT_FORM:
				$baseModel  = $this->getAdmin()->getModel();
				$baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

				$relatedModel = $baseModel->{$this->getName()}()->getRelated();

				$items = [];
				foreach ($relatedModel::all() as $item) {
					$items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
				}

				if ($this->getValue() !== null) {
					$this->setValue($this->getValue()->{$primaryKey});
				}

				return View::make('krafthaus/bauhaus::models.fields._belongs_to')
					->with('field', $this)
					->with('items', $items);

				break;
		}

		return $this->getValue();
	}
1005463
public function run()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $param = Yii::$app->request->get($this->clientIdGetParamName);
        if (mb_strlen($param) < 2) {
            if (YII_DEBUG) {
                throw new InvalidConfigException ("Operator '{$this->clientIdGetParamName}' requires two operands.");
            } else {
                return [];
            }
        } else {
            $query = Tag::find();
            $rows = $query->select(['id', 'name', 'name as text', 'frequency'])
                ->where(['like', 'name', $param])
                ->orderBy(['frequency' => SORT_DESC])
                ->limit(Yii::$app->request->get($this->clientLimitGetParamName, 20))
                ->asArray()
                ->all();
            return $rows;
        }
    }