Returns the code for a link.

@param string $label   The label
@param string $url     The URL
@param array  $options Options for the URL code (class, title, etc)

@return string
351400
public static function link($label, $url = null, array $attributes = array())
    {
        // If the label is null, use the URL
        if ($label === null) {
            $label = $url;
        }

        // If the URL parameter is an object, call its `href()` method.
        if (is_object($url) and method_exists($url, 'href')) {
            $url = $url->href();
        }

        // Is this a local link?
        // if (substr($url, 0, 4) != 'http') {
        //     $url = Request::basePath($url);
        // }

        $attributes['href'] = $url;
        $attributes = static::buildAttributes($attributes);

        return "<a {$attributes}>{$label}</a>";
    }
204154
public static function render( $url, $label, $targetId, $class = NULL )
	{
		$attributes	= array(
			'href'		=> "#".$targetId,
			'class'		=> $class,
			'onclick'	=> "ahah('".$url."','".$targetId."');",
		);
		return UI_HTML_Tag::create( 'a', $label, $attributes );
	}
345746
public function file($name, $label = null, array $options = [])
    {
        $label = $this->getLabelTitle($label, $name);

        $options = array_merge(['class' => 'filestyle', 'data-buttonBefore' => 'true'], $options);

        $options = $this->getFieldOptions($options, $name);
        $inputElement = $this->form->input('file', $name, null, $options);

        $wrapperOptions = $this->isHorizontal() ? ['class' => $this->getRightColumnClass()] : [];
        $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . $this->getHelpText($name, $options) . '</div>';

        return $this->getFormGroup($name, $label, $wrapperElement);
    }
456614
public function getLinkForPage($pageNumber, $label, $htmlOptions = array()) {
        return Html::get()->link($this->getURLForPage($pageNumber), $label, $htmlOptions);
    }
441117
protected function renderOptionTag($value, $label)
    {
        $output = '<option value="' . htmlspecialchars($value) . '"';
        if ($this->isSelected($value)) {
            $output .= ' selected="selected"';
        }

        $output .= '>' . htmlspecialchars($label) . '</option>';

        return $output;
    }
432041
public function addonButton($label, $options = [])
    {
        $attributes = array_merge(['class' => 'btn', 'type' => 'button'], $options);

        if (isset($options['class'])) {
            $attributes['class'] .= ' btn';
        }

        return '<div class="input-group-btn"><button ' . $this->html->attributes($attributes) . '>'.$label.'</button></div>';
    }
108006
public function getUrl(UrlOptionsInterface $options = \null): string
    {
        $query = \null !== $options ? '?'.$options->getQueryString() : '';

        return parent::getUrl().$query;
    }
593177
public static function getLabelName($label)
    {
        if ($label === self::LABEL_OPTIONAL) {
            return 'optional';
        }

        if ($label === self::LABEL_REQUIRED) {
            return 'required';
        }

        if ($label === self::LABEL_REPEATED) {
            return 'repeated';
        }

        return null;
    }
483607
public function postLink($title, array $url, array $options = []) {
		if (!$this->hasAccess($url)) {
			return $this->_default($title, $options);
		}
		unset($options['default']);

		return $this->Form->postLink($title, $url, $options);
	}
262936
protected function getBadgeHtml($label, $colorOrStatus = null, $toolTipLabel = null, $url = null)
    {
        $element = 'span';
        if ($colorOrStatus === null) {
            $color = 'black';
        } else if (in_array($colorOrStatus, AVH::STATUS_LIST)) {
            Checkers::checkStatus($colorOrStatus, 'default');
            $color = AVH::STATUS_COLOR_LIST[$colorOrStatus];
        } else {
            Checkers::checkColor($colorOrStatus);
            $color = $colorOrStatus;
        }
        $attributes = ['class' => 'badge bg-' . $color];
        if ($toolTipLabel !== null) {
            $attributes['data-toggle'] = 'tooltip';
            $attributes['title'] = $toolTipLabel;
        }
        if ($url) {
            $element = 'a';
            $attributes['href'] = $url;
        }
        if (strlen($label) > 30) {
            Checkers::notice('Badge label [' . $label . '] is probably too long');
        }
        return Html::buildHtmlElement($element, $attributes, $label);
    }
1224268
public static function link($title, $url, array $options = [])
    {
        $toolbar = Toolbar::getInstance(self::$_toolbar);
        $options += [
            'icon'   => 'link',
            'button' => 'grey lighten-3'
        ];

        $toolbar->appendButton('Core.link', $title, $url, $options);
    }
580802
public function link($title, $url = null, array $options = [])
    {
        $options = $this->addClass($options, $this->_class(__FUNCTION__));
        $options = Hash::merge([
            'escapeTitle' => false,
            'clear'       => false,
            'label'       => $title,
        ], $options);

        $isClear = (bool) $options['clear'];
        unset($options['clear']);

        $options = $this->_setTitleAttr($title, $options);

        //  Set title in html tag.
        if ($this->_isEscapeTitle($title, $isClear, $options)) {
            $title = $this->tag('span', $title, ['class' => $this->_class(__FUNCTION__) . '-title']);
        }

        $options = $this->_getBtnClass($options);
        $options = $this->_getToolTipAttr($options);

        list($title, $options) = $this->_createIcon($this, $title, $options);
        unset($options['label']);

        return parent::link($title, $url, $options);
    }
813146
public static function menuHeader($label, $htmlOptions = array())
    {
        self::addCssClass('dropdown-header', $htmlOptions);
        return self::tag('li', $htmlOptions, $label);
    }
622641
public static function navbarBrandLink($label, $url, $htmlOptions = array())
    {
        self::addCssClass('navbar-brand', $htmlOptions);
        return self::link($label, $url, $htmlOptions);
    }
1180212
public static function button($label = 'button', $htmlOptions = array())
    {
        $htmlOptions = ArrayHelper::defaultValue('name', \CHtml::ID_PREFIX . \CHtml::$count++, $htmlOptions);
        Html::clientChange('click', $htmlOptions);
        return static::btn('button', $label, $htmlOptions);
    }
195803
public function createLink($label, $href = null)
    {
        $link = new Link($label, $href);

        if ( ! $this->links instanceof ArrayIterator) {
            $this->links = new ArrayIterator();
        }

        $this->links->push($link);
    }
1289366
public function outputLabel($elTpl, $label)
    {
        $mainLabel = is_array($label)? array_shift($label): $label;
        $elTpl     = str_replace('{label}', $mainLabel, $elTpl);
        if (false !== strpos($elTpl, '<qf:label>')) {
            if ($mainLabel) {
                $elTpl = str_replace(array('<qf:label>', '</qf:label>'), array('', ''), $elTpl);
            } else {
                $elTpl = preg_replace('!<qf:label>.*</qf:label>!isU', '', $elTpl);
            }
        }
        if (is_array($label)) {
            foreach($label as $key => $text) {
                $key   = is_int($key)? $key + 2: $key;
                $elTpl = str_replace(array('<qf:label_' . $key . '>', '</qf:label_' . $key . '>', '{label_' . $key . '}'),
                                     array('', '', $text), $elTpl);
            }
        }
        if (strpos($elTpl, '{label_')) {
            $elTpl = preg_replace('!<qf:label_([^>]+)>.*</qf:label_\1>!isU', '', $elTpl);
        }
        return $elTpl;
    }