Return link text

@return mixed|string
172835
protected function getLinkText()
    {
        $value = $this->value;
        if ($this->hasModel()) {
            $model = $this->model;
            if ($value !== null) {
                if (is_string($value)) {
                    $linkText = ArrayHelper::getValue($model, $value);
                } else {
                    $linkText = call_user_func($value, $model);
                }
            } else {
                $linkText = ArrayHelper::getValue($model, $this->attribute);
            }
        } else {
            $linkText = $value;
        }

        return $linkText;
    }
795319
public function render(): string
    {
        $append = str_replace(trim($this->insert), '', $this->insert);

        return "[" . trim($this->escape($this->insert)) . "]({$this->attributes['link']})" . $append;
    }
96904
public function viewLink()
    {
        $link   = null;
        $locale = $this->lang();
        if ($locale !== null) {
            $translator = $this->translator();
            $origLocale = $translator->getLocale();
            $translator->setLocale($this->lang());
            $link = $this->renderTemplate('{{# withBaseUrl }}{{ obj.url }}{{/ withBaseUrl }}');
            $translator->setLocale($origLocale);
        }

        return $link;
    }
985921
public function getText()
    {
        $lines = [];
        if ($this->error->has()) {
            foreach ($this->error->getList() as $error) {
                if ($error instanceof HtmlAwareErrorInterface && $error->messageContainsHtml()) {
                    $lines[] = strip_tags((string) $error);
                } else {
                    $lines[] = (string) $error;
                }
            }
        }

        return implode("\n", $lines);
    }
512274
public function getText()
    {
        $short = $this->getShortDescription();
        $long = $this->getLongDescription()->getContents();

        if ($long) {
            return "{$short}\n\n{$long}";
        } else {
            return $short;
        }
    }
626031
public function getItemLabelAttribute()
    {
        if( $this->type == 'link' ) {
            return $this->link_text;
        }

        if( $this->type == 'page' && ! is_null($this->page) )
            return get_translation_name('title', $this->language_code, $this->page->translations->toArray());

        return '';
    }
805302
public function text($doclet)
    {
        return $this->_linkText($this->_link, $doclet) . ($this->_text ? ' - ' . $this->_text : '');
    }
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;
	}
1167029
public function links($text, $limit = null)
    {
        // Set link limit
        $limit = is_null($limit) ? $this->getConfig('defaultMaxLinks', 10) : $limit;

        // Normalize string before passing
        $text = $this->prepare($text);

        // Get link matches
        preg_match_all("!((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)!", $text, $matches);

        return (count($matches[0]) >= (int) $limit);
    }
1000457
def get_link_page_text(link_page):
        
        text = ''
        for i, link in enumerate(link_page):
            capped_link_text = (link['text'] if len(link['text']) <= 20
                                else link['text'][:19] + '…')
            text += '[{}] [{}]({})\n'.format(i, capped_link_text, link['href'])
        return text
1041260
public function getHeaderText(): string
    {
        $header      = $this->getHeaderElement();
        $header_text = $header->getText();
        $header_link = $header->find('css', 'a');

        // The page headers can often include an 'add new link'. Strip that out of the header text.
        if ($header_link) {
            $header_text = trim(str_replace($header_link->getText(), '', $header_text));
        }

        return $header_text;
    }
1179892
public function getLink()
    {
        if ($this->oxmediaurls__oxisuploaded->value) {
            $sUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->isSsl() ? \OxidEsales\Eshop\Core\Registry::getConfig()->getSslShopUrl() : \OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl();
            $sUrl .= 'out/media/';
            $sUrl .= basename($this->oxmediaurls__oxurl->value);
        } else {
            $sUrl = $this->oxmediaurls__oxurl->value;
        }

        return $sUrl;
    }
463330
public static function getLinkUrl()
    {
        $theme = self::getCurrentTheme();
        if (
            $theme instanceof ConfigurableTheme ||
            $theme instanceof ConfigurablePlatformTheme
        ) {
            $link = $theme->getLink();
            if (! empty($link)) {
                return $link;
            }
        }


        //move this into the standard template setData()
        switch (TAO_RELEASE_STATUS) {
            case 'alpha':
            case 'demoA':
            case 'beta':
            case 'demoB':
                $link = 'https://forum.taocloud.org/';
                break;
            default:
                $link = 'http://taotesting.com';
                break;
        }

        return $link;
    }
703729
public static function link($text, $link = '#', array $attributes = array())
    {
        if (!is_null($link)) {
            $attributes['href'] = $link;
        }

        $node = new Node\Link($text);
        return $node->render($attributes);
    }
453881
protected function getLink()
    {
        if ($this->link_value === null) {
            $link = $this->link;
        } elseif (is_array($this->link_value)) {
            $link_values = array();

            foreach ($this->link_value as $value) {
                $link_values[] = urlencode($value);
            }

            $link = vsprintf($this->link, $link_values);
        } else {
            $link_value = urlencode($this->link_value);
            $link = sprintf($this->link, $link_value);
        }

        return $link;
    }
586508
def get_text(element):
    '''  '''
    _add_links_to_text(element)
    try:
        return element.text(squash_space=False)
    except TypeError:
        return element.text()
1358323
public function EditorEmailLink()
    {
        // Show link text field if requested
        $showLinkText = $this->controller->getRequest()->getVar('requireLinkText');
        $factory = EditorEmailLinkFormFactory::singleton();
        return $factory->getForm(
            $this->controller,
            "{$this->name}/EditorEmailLink",
            [ 'RequireLinkText' => isset($showLinkText) ]
        );
    }