Skip to main content

Link

A link element, including the link destination and label text.

Classname

Photon\CmsEngine\Model\Element\Link

Attributes

AttributeTypeDescription
$urlstringThe content of the href attribute of the link's HTML element
$titlestringThe text the link will be applied to
$subtitlestringAdditional 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
$activebooleanThe link has been selected
$disabledbooleanThe 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);