Render $link into html.

This method is generally called via double-dispatch, as provided by Visitor\VisitableTrait.

@param LinkInterface $link
@return string
547599
public function visitLink(LinkInterface $link)
    {

        $template = 'link/' . $link->getType() . '.twig';

        return $this
            ->loadTemplate($template)
            ->render(
                [
                    "id" => $link->getId(),
                    "classes" => $link->getClasses(),
                    "data" => $link->getData(),
                    "uri" => $link->getURI(),
                    "text" => $link->getText(),
                ]
            );
    }
1315108
public function getLink($link)
    {
        return isset($this->link[$link]) ? $this->link[$link] : null;
    }
913175
public function image(string $link, string $title = null, string $view = null): string
    {
        $view = $view ?: 'column.linkImage';

        return GridView::view($view, [
            'link'  => $link,
            'title' => $title,
        ])->render();
    }
773929
protected function getLink($link) {
		$page = new \Phile\Repository\Page();
		$linked_page = $page->findByPath($link);

		if ($linked_page) {
			// the user linked to an internal page
			return \Phile\Utility::getBaseUrl() . '/'. $linked_page->getUrl();
		}

		$file = ROOT_DIR . DIRECTORY_SEPARATOR . $link;
		if (file_exists($file)) {
			// the user linked to an internal file
			return \Phile\Utility::getBaseUrl() . '/' . $link;
		}

		// it's not an internal page, it's not an internal file -
		// let's see if it's (at least) a somewhat valid URL
		$url_parts = parse_url($link);

		if (is_array($url_parts)) {
			if (!array_key_exists("scheme", $url_parts)) {
				// it doesn't have a http:// or https:// or similar prefix.
				// This could mean the user provided something like: (link: cnn.com)
				// -> check if the first part of the link looks like a domain name
				$p = explode('/', $url_parts["path"]);
				$domain = $p[0];

				if ($this->isValidDomainName($domain)) {
					// the first part of the link looks like a valid domain name
					// -> just prepend 'http://' and continue
					return "http://$link";
				}
			}
		}

		// If we get to this point, we just return whatever the user typed.
		return $link;
	}
1314697
protected function _renderScript($script, $link, $attribs = array())
    {
        if ($link) {
            $script = pick($this->getService('com:base.template.asset')->getURL($script), $script);
        }

        //if ajax try to get the content of the file
        if (AnRequest::type() == 'AJAX') {
            if ($link) {
                $file = $this->getService('com:base.template.asset')->getFilePath($script);
                if ($file) {
                    $script = file_get_contents($file);
                    $link = false;
                }
            }

            return parent::_renderScript($script, $link, $attribs);
        }

        $document = AnService::get('anahita:document');

        if($link) {
            return $document->addScript($script, 'text/javascript');
        } else {
            return $document->addScriptDeclaration($script);
        }
    }
34474
public static function create(string $href): LinkBuilderInterface
    {
        $self = new self();
        $self->href = $href;
        $self->rels = [];
        $self->attributes = [];

        return $self;
    }
500994
protected function renderChildElement(Descriptor $descriptor, $linkTitle) {
		$element = $this->renderElement($descriptor);
		$link    = $this->getTagsLocator()->get('link');

		if (is_string($linkTitle)) {
			return $element . $link->render($linkTitle);
		}

		return $element . $link->render();
	}
558912
public function clickLinkInHeader(string $link)
    {
        $header_link = $this->find('css', '.page-title-action');

        if ($header_link->getText() === $link) {
            $header_link->click();
        } else {
            $this->getHeaderElement()->clickLink($link);
        }
    }
397934
public function insertId($link = null)
    {
        is_null($link) && $link = $this->wlink;
        return $link->lastInsertId();
    }
344264
public function render($html = null) {
		if ($html === null && $this->getHtml() === '') {
			$html = $this->getLink();
		}
		
		return parent::render($html);
	}
495889
public function render(PageInterface $page)
    {
        $templateName = $this->locateTemplate();

        return $this
            ->engine
            ->render(
                $templateName, [
                    'page' => $page,
                ]
            );
    }
660188
public function linkBuilder($link)
    {
        if (is_array($link)) {
            list($route, $params) = $link;

            return $this->generateLink($route, $params);
        } else {
            return $this->generateLink($link, null);
        }
    }
1148307
public function render(RenderInterface $render)
    {
        $this->render = $render;
        $this->render->setConfig($this->config);
        return $this->render->render();
    }
967080
public function render(AbstractInline $inline, CliRenderer $renderer)
    {
        if (!($inline instanceof Link)) {
            throw new \InvalidArgumentException(sprintf('Incompatible inline type: "%s"', get_class($inline)));
        }

        return $renderer->style($renderer->renderInlines($inline->children()), ['underline', 'bold', 'light_blue']);
    }
369222
public static function href($link) {
        if(isset($link['uri']) || isset($link['fragment'])) {
            return ' href="'.URI::getHref($link).'"';
        }
        return false;
    }
420646
public function getLink($link)
    {
        if (isset($this->links->$link->redirectHref)) {
            return $this->links->$link->redirectHref;
        }

        if (isset($this->links->$link->href)) {
            return $this->links->$link->href;
        }

        return $this->links->$link;
    }
1360083
public function render(ElementInterface $element, $blockWrapper = null, $inlineWrapper = null)
    {
        $html   = '';
        $inline = $element->getOption('help-inline');
        $block  = $element->getOption('help-block');
        if ($inline) {
            $html .= sprintf($inlineWrapper ?: $this->inlineWrapper, $inline);
        }
        if ($block) {
            $html .= sprintf($blockWrapper ?: $this->blockWrapper, $block);
        }
        return $html;
    }