Turn the current Medium into a Link

@param  bool $reset
@param  array  $attributes
@return Link
423893
public function link($reset = true, array $attributes = [])
    {
        $attributes['href'] = $this->url(false);
        $srcset = $this->srcset(false);
        if ($srcset) {
            $attributes['data-srcset'] = $srcset;
        }

        return parent::link($reset, $attributes);
    }
941188
public static function block_tags( $reset = false ) {
		if ( empty( self::$block_tags ) || $reset ) {
			self::$block_tags = \array_merge(
				\array_flip(
					\array_filter(
						\array_keys( Elements::$html5 ),
						function( $tag ) {
							return Elements::isA( $tag, Elements::BLOCK_TAG );
						}
					)
				),
				\array_flip( [ 'li', 'td', 'dt' ] ) // not included as "block tags" in current HTML5-PHP version.
			);
		}

		return self::$block_tags;
	}
565300
public function setResetParams($resetParams)
        {
            $this->_resetParams = (bool) $resetParams;
            $this->_hrefCache   = null;

            return $this;
        }
642523
public static function url($name, $value, array $attributes = array())
    {
        $node = new Node\Url();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
884737
public function link($content, $url = '', $attributes = array())
    {
        $attributes['href'] = $url;

        return $this->tag('a', $content, $attributes);
    }
183917
public static function form( array $attributes = array(), $value = null, $close = false )
    {
        return static::tag( 'form', $attributes, $value, $close );
    }
1274925
public static function icon($icon, $link, array $attributes = array())
    {
        // Inner text
        $text = sprintf('<i class="%s"></i> ', $icon);

        return self::link($text, $link, $attributes);
    }
646507
public function referrer($default = null, $attributes = null)
    {
        $referrer = $_SERVER['HTTP_REFERER'] ?? null;

        // Check that referrer came from our site.
        $root = $this->rootUrl(true);
        if ($referrer) {
            // Referrer should always have host set and it should come from the same base address.
            if (stripos($referrer, $root) !== 0) {
                $referrer = null;
            }
        }

        if (!$referrer) {
            $referrer = $default ?: $this->route(true, true);
        }

        if ($attributes) {
            $referrer .= $attributes;
        }

        // Return relative path.
        return substr($referrer, strlen($root));
    }
1322459
public static function LinkToUnlessCurrent($label, $url, array $attributes = array())
    {
        if (Request::matches($url)) {
            return $label;
        } else {
            return static::link($label, $url, $attributes);
        }
    }
969930
public static function factory($link, array $attrs = [])
    {
        if (URL::getAssetId($link) > 0) {
            return new AssetLink($link, $attrs);
        }

        if (is_numeric($link) || URL::isInternal($link)) {
            return new PageLink($link, $attrs);
        }

        return new External($link, $attrs);
    }
659324
public function setParams(array $data = [], $reset = false)
    {
        if ($reset) {
            $this->_data = $data;
        }
        foreach ($data as $key => $value) {
            $this->__set($key, $value);
        }
        return $this;
    }
448243
public function link($text, $href, $label=false, array $attr=[]){
		$field = $this->factory('link', false, $label, array_merge(array('text' => $text, 'href' => $href), $attr));
		return $this->addField($field);
	}
1332860
public function style($url, $attributes = [], $secure = null)
    {
        $defaults = ['media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet'];

        $attributes = array_merge($defaults, $attributes);

        $attributes['href'] = $this->url->asset($url, $secure);

        return $this->toHtmlString('<link' . $this->attributes($attributes) . '>');
    }
1229214
public static function link($url, $text, array $attributes = null) {
        $attributes = (array)$attributes;
        $attributes['href']  = $url;
        return self::tag('a', $text, $attributes);
    }
604134
public function updateLink($id, array $attributes): bool
	{
		$success = true;

		$foreignKey = $this->getForeignKey();

		$foreignKeyValue = $this->parent->getPrimaryKeyValue();

		$junctionKey = $this->getJunctionKey();

		foreach($this->getJunctionKeys($id) as $key => $id)
		{
			$success = $success && (bool) $this->junction()->where($foreignKey, '=', $foreignKeyValue)->where($junctionKey, '=', $id)->update($this->getJunctionAttributes($key, $attributes));
		}

		return $success;
	}
673038
public function url($reset = true)
    {
        /** @var UniformResourceLocator $locator */
        $locator = Grav::instance()['locator'];
        $image_path = $locator->findResource('cache://images', true);
        $image_dir = $locator->findResource('cache://images', false);
        $saved_image_path = $this->saveImage();

        $output = preg_replace('|^' . preg_quote(GRAV_ROOT, '|') . '|', '', $saved_image_path);

        if ($locator->isStream($output)) {
            $output = $locator->findResource($output, false);
        }

        if (Utils::startsWith($output, $image_path)) {
            $output = '/' . $image_dir . preg_replace('|^' . preg_quote($image_path, '|') . '|', '', $output);
        }

        if ($reset) {
            $this->reset();
        }

        return trim(Grav::instance()['base_url'] . '/' . $this->urlQuerystring($output), '\\');
    }
1154616
public function sendResetLink(array $credentials): string
    {
        // First we will check to see if we found a user at the given credentials and
        // if we did not we will redirect back to this current URI with a piece of
        // "flash" data in the session to indicate to the developers the errors.

        if (\is_null($user = $this->getUser($credentials))) {
            return static::INVALID_USER;
        }

        // Once we have the reminder token, we are ready to send a message out to the
        // user with a link to reset their password. We will then redirect back to
        // the current URI having nothing set in the session to indicate errors.
        $user->sendPasswordResetNotification(
            $this->tokens->create($user), $this->provider
        );

        return static::RESET_LINK_SENT;
    }