Interface luya\tag\TagInterface
| Implemented by | luya\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 version | 1.0.0 |
| Source Code | https://github.com/luyadev/luya/blob/master/core/tag/TagInterface.php |
TagInterface for all LUYA Tags
Public 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
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 |
|---|---|---|
public function example();
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
$valueof the parse method. - John Doe represents
$subof 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 |
| return | string |
The new generated string of the Tag. |
|---|---|---|
public function parse($value, $sub);