Paragraph::createLink

@param string      $label
@param string|null $href

@return Link
552380
public function createLink($label, $href = null)
    {
        if ( ! $this->attributes->hasAttributeClass('lead')) {
            $this->attributes->addAttributeClass('lead');
        }

        $link = new Link($label, $href);
        $link->attributes->addAttributeClass(['btn', 'btn-primary', 'btn-lg']);
        $this->childNodes->push($link);

        return $this->childNodes->last();
    }
476950
public function addLink($name, $label = '', $attr = [] )
    {
        $e = new \FrenchFrogs\Form\Element\Link($name, $label, $attr);
        $this->addElement($e);
        return $e;
    }
1162799
public function addFootnote($text, $label = null)
    {
        if (isset($this->_parentConfig))
            return ($this->_parentConfig->addFootnote($text, $label));
        if (is_null($label))
            $this->_footnotes[] = $text;
        else
            $this->_footnotes[] = array(
                'label' => $label,
                'text' => $text
            );
        $index = count($this->_footnotes);
        return (array(
            'id' => $this->getParam('footnotesPrefix') . "-$index",
            'index' => $index
        ));
    }
318827
public static function closeLink($label = self::CLOSE_TEXT, $url = '#', $htmlOptions = array())
    {
        $htmlOptions['href'] = $url;
        return self::close('a', $label, $htmlOptions);
    }
915458
protected function createLink(DataGrid $grid, $href, $params)
	{
		/**
		 * Int case of ActionCallback, $this->href is a identifier of user callback
		 */
		$params = $params + ['__key' => $this->href];

		return $this->grid->link('actionCallback!', $params);
	}
661338
public function resetLink($label, array $options = [])
    {
        return $this->Html->link($label, $this->resetUrl(), $options);
    }
241468
public function linkCell(string $link) : LinkCell
    {
        $this->addCell($cell = new LinkCell($link));

        return $cell;
    }
595648
public static function escape($label) {
        if (empty(self::$escaper)) {
            self::$escaper = new \Behat\Mink\Selector\Xpath\Escaper();
        }
        return self::$escaper->escapeLiteral($label);
    }
1322459
public static function LinkToUnlessCurrent($label, $url, array $attributes = array())
    {
        if (Request::matches($url)) {
            return $label;
        } else {
            return static::link($label, $url, $attributes);
        }
    }
246286
public static function collapseLink($label, $target, $htmlOptions = array())
    {
        $htmlOptions['data-toggle'] = 'collapse';
        return self::link($label, $target, $htmlOptions);
    }
24327
public function createItem($label = null, $href = null)
    {
        $link = new Link($label, $href);
        $link->attributes->addAttributeClass('dropdown-item');

        $this->childNodes->push($link);

        return $this->childNodes->last();
    }
754541
public static function anchor($href, $text = null, $attr = array(), $secure = null)
	{
		if ( ! preg_match('#^(\w+://|javascript:|\#)# i', $href))
		{
			$urlparts = explode('?', $href, 2);
			$href = \Uri::create($urlparts[0], array(), isset($urlparts[1])?$urlparts[1]:array(), $secure);
		}
		elseif ( ! preg_match('#^(javascript:|\#)# i', $href) and is_bool($secure))
		{
			$href = http_build_url($href, array('scheme' => $secure ? 'https' : 'http'));

			// Trim the trailing slash
			$href = rtrim($href, '/');
		}

		// Create and display a URL hyperlink
		is_null($text) and $text = $href;

		$attr['href'] = $href;

		return html_tag('a', $attr, $text);
	}
192528
protected static function linkEmbed($arguments, $href, $title)
    {
        $title = !empty($arguments['caption']) ? ($arguments['caption']) : $title;
        unset($arguments['caption']);
        unset($arguments['width']);
        unset($arguments['height']);
        unset($arguments['url']);
        $arguments['href'] = $href;
        return HTML::createTag('a', $arguments, Convert::raw2xml($title));
    }
854732
public function createBullet($bullet, $href = null)
    {
        if (strpos($bullet, 'http') || is_file($bullet)) {
            $icon = new Image($bullet);
        } else {
            $icon = new Element('i', 'bullet');
            $icon->attributes->addAttributeClass($bullet);
        }

        $link = new Link($icon, $href);
        $link->attributes->addAttributeClass('nav-link');

        return $this->createList($link);
    }
323379
public function add($label, $url='')
    {
        if (is_array($label)) {
            if (count($label) > 0) foreach ($label as $crumb) {
                $defaults = [
                    'label' => '',
                    'url'   => ''
                ];
                $crumb = array_merge($defaults, $crumb);
                $this->add($crumb['label'], $crumb['url']);
            }
        } else {
            $label = trim(strip_tags($label, '<i><b><strong>'));
            if (! preg_match('|^http(s)?|', $url)) {
                $url = URL::to($url);
            }
            $this->crumbs[] = array('label' => $label, 'url' => $url);
        }

        return $this;
    }
226630
protected function createLink(DataGrid $grid, $href, $params)
	{
		$targetComponent = $grid;

		if (strpos($href, ':') !== false) {
			return $grid->getPresenter()->link($href, $params);
		}

		for ($iteration = 0; $iteration < 10; $iteration++) {
			$targetComponent = $targetComponent->getParent();

			if ($targetComponent === null) {
				$this->throwHierarchyLookupException($grid, $href, $params);
			}

			try {
				@$link = $targetComponent->link($href, $params);

			} catch (InvalidLinkException $e) {
				$link = false;
			} catch (Nette\InvalidArgumentException $e) {
				$link = false;
			}

			if ($link) {
				if (
					strpos($link, '#error') === 0 ||
					(strrpos($href, "!") !== false && strpos($link, '#') === 0) ||
					(in_array($grid->getPresenter()->invalidLinkMode, [Presenter::INVALID_LINK_WARNING, Presenter::INVALID_LINK_SILENT], true) && strpos($link, '#') === 0)
				) {
					continue; // Did not find signal handler
				}

				return $link; // Found signal handler!
			} else {
				continue; // Did not find signal handler
			}

			if ($targetComponent instanceof Presenter) {
				// Went the whole way up to the UI\Presenter and did not find any signal handler
				$this->throwHierarchyLookupException($grid, $href, $params);
			}
		}

		// Went 10 steps up to the UI\Presenter and did not find any signal handler
		$this->throwHierarchyLookupException($grid, $href, $params);
	}
740205
public function createLink($label, $href = null, $position = self::NAVBAR_LEFT)
    {
        if ( ! is_object($label) && isset($href)) {
            $label = new Link($label, $href);
        }

        switch ($position) {
            default:
            case self::NAVBAR_LEFT:
                $node = $this->left->createList($label);
                break;

            case self::NAVBAR_RIGHT:
                $node = $this->right->createList($label);
                break;
        }

        return $node;
    }