Interface luya\tag\TagInterface

Implemented byluya\admin\tags\FileTag, luya\cms\tags\AliasTag, luya\cms\tags\MenuTag, luya\cms\tags\PageTag, luya\tag\BaseTag, luya\tag\tags\LinkTag, luya\tag\tags\MailTag, luya\tag\tags\TelTag
Available since version1.0.0

TagInterface for all LUYA Tags

Public Methods

Hide inherited methods

Method Description Defined By
example() Provide a single example tag which is used as value when clicking on an tag in the administration interface in order to insert the tag at the texteditor location. luya\tag\TagInterface
parse() Parse the the values of the tag into your output text. luya\tag\TagInterface
readme() Get the readme informations of the current tag, markdown syntax is allowed. luya\tag\TagInterface

Method Details

Hide inherited methods

example() public abstract method

Provide a single example tag which is used as value when clicking on an tag in the administration interface in order to insert the tag at the texteditor location.

public abstract string example ( )
return string

The example string like mail[info@luya.io](Mail us!).

                public function example();

            
parse() public abstract method

Parse the the values of the tag into your output text.

Assuming the following tag value mytag[Hello](John Doe), the values are injected to parse() as following

  • Hello represents $value of the parse method.
  • John Doe represents $sub of parse method.

The $sub variables can also be null and is not required by any tag. Assuming mytag[Hello] means that $sub is null.

The output of parse() is what will be replaced withing this tag. Assuming the above example mytag[Hello](John Doe) with the parse logic:

public function parse($value, $sub)
{
    return "{$value}, {$sub}";
}

Woud replace and return tag with Hello, John Doe.

public abstract string parse ( $value, $sub )
$value string

The value of the tag enclosed by square bracket []

$sub string|null

The optional value of the tag enclise by round bracket (), is not required by tag. If not provided equals null.

return string

The new generated string of the Tag.

                public function parse($value, $sub);

            
readme() public abstract method

Get the readme informations of the current tag, markdown syntax is allowed.

public abstract string readme ( )
return string

The readme string with allowed markdown syntax.

                public function readme();