Get links

@return string
18536
public function getLinks()
    {
        $links = '';
        foreach ($this->links as $link) {
            $links .= $link . "\n";
        }
        $links = rtrim($links, "\n");
        return $links;
    }
1302827
protected function _getBaseUrlPaths() {
        $paths = array();
        $linkTypes = array(Mage_Core_Model_Store::URL_TYPE_LINK,
                            Mage_Core_Model_Store::URL_TYPE_JS,
                            Mage_Core_Model_Store::URL_TYPE_SKIN,
                            Mage_Core_Model_Store::URL_TYPE_MEDIA);
        foreach (Mage::app()->getStores() as $store) {
            foreach ($linkTypes as $linkType) {
                $paths[] = parse_url($store->getBaseUrl($linkType, false),
                    PHP_URL_PATH);
                $paths[] = parse_url($store->getBaseUrl($linkType, true),
                    PHP_URL_PATH);
            }
        }
        $paths = array_unique($paths);
        usort($paths, create_function('$a, $b',
            'return strlen( $b ) - strlen( $a );'));
        return array_values($paths);
    }
376579
public function getLinks()
    {
        if (!isset($this->_links)) {
            $this->_links = array();

            foreach ($this->_resources as $resource) {
                $link = $resource->getLink();

                if ($link) {
                    $this->_links[] = new AnConfig(array(
                        'child' => $resource->getColumn($link->child),
                        'parent' => $this->main()->getColumn($link->parent),
                        'resource' => $resource,
                    ));
                }
            }
        }

        return $this->_links;
    }
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;
    }
61204
public function getLink()
    {
        if ($this->_sLink === null || $this->getLanguageId() != \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage()) {
            $this->_sLink = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->cleanUrl($this->getArticle()->getLink(), ['force_sid']);
        }

        return $this->getSession()->processUrl($this->_sLink);
    }
1361685
public function getLinkPage()
    {
        $pageId = (int) $this->getParsedValue()->PageID;
        if (!$pageId) {
            return null;
        }

        return DataObject::get_by_id(SiteTree::class, $pageId);
    }
608584
public function getMenu()
    {
        $this->links->each(
            function ($link) {
                if (!$link->children->isEmpty()) {
                    $link->children = $link->children->sortBy('weight')->values();
                }
            }
        );
        return $this->links->sortBy('weight')->values();
    }
330138
def _get_links(self,):
        
        res = ''
        if self.links:
            for l in self.links:
                res += ' links = ' + str(l[0]) + '\n'
                if l[0].child_nodes:
                    for chld in l[0].child_nodes:
                        res += '   child = ' + str(chld) + '\n'
                if l[0].links:
                    for lnk in l[0].links:
                        res += '   sublink = ' + str(lnk[0]) + '\n'
        else:
            res += ' links = None\n'
            
        return res
915807
public function getLinks($nb = 5)
    {
        $links = [];
        $fistPage = $this->getFirstPage();
        $lastPage = $this->getLastPage();
        $currentPage = $this->getPage();

        $firstLink = $currentPage - $nb;
        $lastLink = $currentPage + $nb;

        if ($fistPage > $firstLink) {
            $firstLink = $fistPage;
        }
        if ($lastPage < $lastLink) {
            $lastLink = $lastPage;
        }

        for ($i = $firstLink; $i <= $lastLink; ++$i) {
            $links[$i] = $i;
        }

        return $links;
    }
1143187
public function getLink()
    {
        if ($this->owner->isURL() && $this->owner->LinkURL) {
            return $this->owner->dbObject('LinkURL')->URL();
        }
        
        if ($this->owner->isPage() && $this->owner->LinkPageID) {
            return $this->owner->LinkPage()->Link();
        }
    }
832415
private function get_opening_links()
    {
        $output = '';

        $previous_link = esc_attr(get_pagenum_link(\intval($this->current_page) - 1));
        $first_page_link = esc_attr(get_pagenum_link(1));

        if ($this->args['show_first_last'] && $first_page_link && $this->current_page > 2) {
            $output .= \sprintf($this->args['first_wrapper'], $first_page_link);
        }

        if ($this->args['show_previous_next'] && $previous_link && $this->current_page !== 1) {
            $output .= \sprintf($this->args['previous_wrapper'], $previous_link);
        }

        return $output;
    }
1160909
public function getLinks($all = false)
    {
        $links = [];

        $this->getLinksByTagAttribute("link", "href", $links);
        $this->getLinksByTagAttribute("a", "href", $links);
        $this->getLinksByTagAttribute("script", "src", $links);
        $this->getLinksByTagAttribute("iframe", "src", $links);
        $this->getLinksByTagAttribute("img", "src", $links);

        //get all string started with http
        $regexUrl = '/[">\s]+((http|https|ftp|ftps)\:\/\/(.*?))["<\s]+/';
        $urls     = null;
        if (preg_match_all($regexUrl, $this->html, $urls) > 0) {
            $matches = $urls[1];
            foreach ($matches as $url) {
                if (filter_var($url, FILTER_VALIDATE_URL)) {
                    $links[$url] = $url;
                }
            }
        }

        if ($all) {
            //get all params which can be a url
            $regexParam = '/["](.*?)["]/';
            $params     = [];
            if (preg_match_all($regexParam, $this->html, $params) > 0) {
                $urls = $params[1];
                foreach ($urls as $url) {
                    $url = trim($url);
                    if ((strpbrk($url, "/.") !== false) && (strpbrk($url, " ") === false)) {
                        $links[$url] = $url;
                    }
                }
            }
        }

        foreach ($links as $link) {
            $url = parse_url($link);
            if (!((isset($url['host']) && isset($url['scheme'])) || (isset($url['path'])))) {
                unset($links[$link]);
            }
        }

        return $links;
    }
622386
protected function _getPaginationLinks($pagination)
    {
        $links = [
            Link::SELF => null,
            Link::FIRST => null,
            Link::LAST => null,
            Link::PREV => null,
            Link::NEXT => null,
        ];

        if (isset($pagination['self'])) {
            $links[Link::SELF] = new Link($pagination['self'], null, true);
        }

        if (isset($pagination['first'])) {
            $links[Link::FIRST] = new Link($pagination['first'], null, true);
        }

        if (isset($pagination['last'])) {
            $links[Link::LAST] = new Link($pagination['last'], null, true);
        }

        if (isset($pagination['prev'])) {
            $links[Link::PREV] = new Link($pagination['prev'], null, true);
        }

        if (isset($pagination['next'])) {
            $links[Link::NEXT] = new Link($pagination['next'], null, true);
        }

        return $links;
    }
1049394
public function get_permalink() {
        $link = $this->_get_discussionlink();
        $link->set_anchor($this->get_postanchor());

        return $link->out(false);
    }
77660
protected function getPageLinksArray()
    {
        $links = [];
        $types = $this->getPageLinkTypes();

        $links[] = ['name' => Lang::get('backend::lang.pagelist.select_page'), 'url' => false];

        $iterator = function ($links, $level = 0) use (&$iterator) {
            $result = [];
            foreach ($links as $linkUrl => $link) {

                /*
                 * Remove scheme and host from URL
                 */
                $baseUrl = Request::getSchemeAndHttpHost();
                if (strpos($linkUrl, $baseUrl) === 0) {
                    $linkUrl = substr($linkUrl, strlen($baseUrl));
                }

                $linkName = str_repeat('&nbsp;', $level * 4);
                $linkName .= is_array($link) ? array_get($link, 'title', '') : $link;
                $result[] = ['name' => $linkName, 'url' => $linkUrl];

                if (is_array($link)) {
                    $result = array_merge(
                        $result,
                        $iterator(array_get($link, 'links', []), $level + 1)
                    );
                }
            }

            return $result;
        };

        foreach ($types as $typeCode => $typeName) {
            $links = array_merge($links, $iterator($this->getPageLinks($typeCode)));
        }

        return $links;
    }
345573
public function get_links($rel = 'alternate')
	{
		if (!isset($this->data['links']))
		{
			$this->data['links'] = array();
			foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
			{
				if (isset($link['attribs']['']['href']))
				{
					$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
					$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));

				}
			}
			foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
			{
				if (isset($link['attribs']['']['href']))
				{
					$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
					$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
				}
			}
			if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
			{
				$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
			}
			if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
			{
				$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
			}
			if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
			{
				$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
			}
			if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
			{
				if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true')
				{
					$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
				}
			}

			$keys = array_keys($this->data['links']);
			foreach ($keys as $key)
			{
				if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
				{
					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
					{
						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
						$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
					}
					else
					{
						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
					}
				}
				elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
				{
					$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
				}
				$this->data['links'][$key] = array_unique($this->data['links'][$key]);
			}
		}
		if (isset($this->data['links'][$rel]))
		{
			return $this->data['links'][$rel];
		}
		else
		{
			return null;
		}
	}
281103
public function getLink()
    {
        return Controller::join_links(
            $this->Blog()->Link(),
            $this->getListUrlSegment(),
            $this->URLSegment
        );
    }