Link
A link element, including the link destination and label text.
Classname
Photon\CmsEngine\Model\Element\Link
Attributes
Attribute | Type | Description |
---|---|---|
$url | string | The content of the href attribute of the link's HTML element |
$title | string | The text the link will be applied to |
$subtitle | string | Additional text that the link will be applied to, commonly used to split the title to allow additional HTML elements to be applied and styled differently |
$active | boolean | The link has been selected |
$disabled | boolean | The link should be displayed as disabled in the user interface |
<?php
use Photon\CmsEngine\Model\Element\Link;
$azLink = new Link();
$azLink->setTitle($char);
$azLink->setUrl(
$this->urlGenerator->generate(
'atoz_list',
[
'startsWith' => $char,
]
)
);
$azLink->setDisabled($count > 0);