Interface luya\web\LinkInterface

Implemented byluya\admin\file\Item, luya\cms\menu\Item, luya\web\BaseLink, luya\web\EmailLink, luya\web\TelephoneLink, luya\web\WebsiteLink
Available since version1.0.0
Source Code https://github.com/luyadev/luya/blob/master/core/web/LinkInterface.php

Link Resource Interface.

Each Linkable resource object must integrate this interface in order to define the structure of a Linkable resource.

<a href="<?= $object->getHref(); ?>" target="<?= $object->getTarget(); ?>">Go To</a>

When implementing the LinkInterface its very common to also use the {{luya\web\LinkTrait}}.

Public Methods

Hide inherited methods

Method Description Defined By
getHref() Get the href attribute value inside the Link tag. luya\web\LinkInterface
getTarget() Get the target attribute value inside the Link tag. luya\web\LinkInterface

Method Details

Hide inherited methods

getHref() public abstract method

Get the href attribute value inside the Link tag.

public abstract string getHref ( )
return string

Returns the href string which can be either with or without domain.

                public function getHref();

            
getTarget() public abstract method

Get the target attribute value inside the Link tag.

Can be either _blank, _self.

public abstract string getTarget ( )
return string

Returns the target string value for the link resource.

                public function getTarget();