Unverified Commit 07905362 authored by larowlan's avatar larowlan
Browse files

Issue #3163487 by sudiptadas19, IT-Cru, raman.b, idebr, dawehner: Breadcrumb:...

Issue #3163487 by sudiptadas19, IT-Cru, raman.b, idebr, dawehner: Breadcrumb: $title could be an array, but Link() requires a string
parent 39110888
......@@ -18,9 +18,12 @@ class Link implements RenderableInterface {
protected $linkGenerator;
/**
* The text of the link.
*
* @var string
* The link text for the anchor tag as a translated string or render array.
* Strings will be sanitized automatically. If you need to output HTML in
* the link text, use a render array or an already sanitized string such as
* the output of \Drupal\Component\Utility\Xss::filter() or
* \Drupal\Component\Render\FormattableMarkup.
* @var string|array|\Drupal\Component\Render\MarkupInterface
*/
protected $text;
......@@ -34,8 +37,12 @@ class Link implements RenderableInterface {
/**
* Constructs a new Link object.
*
* @param string $text
* The text of the link.
* @param string|array|\Drupal\Component\Render\MarkupInterface $text
* The link text for the anchor tag as a translated string or render array.
* Strings will be sanitized automatically. If you need to output HTML in
* the link text, use a render array or an already sanitized string such as
* the output of \Drupal\Component\Utility\Xss::filter() or
* \Drupal\Component\Render\FormattableMarkup.
* @param \Drupal\Core\Url $url
* The url object.
*/
......@@ -49,6 +56,10 @@ public function __construct($text, Url $url) {
*
* @param string|array|\Drupal\Component\Render\MarkupInterface $text
* The link text for the anchor tag as a translated string or render array.
* Strings will be sanitized automatically. If you need to output HTML in
* the link text, use a render array or an already sanitized string such as
* the output of \Drupal\Component\Utility\Xss::filter() or
* \Drupal\Component\Render\FormattableMarkup.
* @param string $route_name
* The name of the route
* @param array $route_parameters
......@@ -66,8 +77,12 @@ public static function createFromRoute($text, $route_name, $route_parameters = [
/**
* Creates a Link object from a given Url object.
*
* @param string $text
* The text of the link.
* @param string|array|\Drupal\Component\Render\MarkupInterface $text
* The link text for the anchor tag as a translated string or render array.
* Strings will be sanitized automatically. If you need to output HTML in
* the link text, use a render array or an already sanitized string such as
* the output of \Drupal\Component\Utility\Xss::filter() or
* \Drupal\Component\Render\FormattableMarkup.
* @param \Drupal\Core\Url $url
* The Url to create the link for.
*
......@@ -80,7 +95,12 @@ public static function fromTextAndUrl($text, Url $url) {
/**
* Returns the text of the link.
*
* @return string
* @return string|array|\Drupal\Component\Render\MarkupInterface
* The link text for the anchor tag as a translated string or render array.
* Strings will be sanitized automatically. If you need to output HTML in
* the link text, use a render array or an already sanitized string such as
* the output of \Drupal\Component\Utility\Xss::filter() or
* \Drupal\Component\Render\FormattableMarkup.
*/
public function getText() {
return $this->text;
......@@ -89,8 +109,12 @@ public function getText() {
/**
* Sets the new text of the link.
*
* @param string $text
* The new text.
* @param string|array|\Drupal\Component\Render\MarkupInterface $text
* The link text for the anchor tag as a translated string or render array.
* Strings will be sanitized automatically. If you need to output HTML in
* the link text, use a render array or an already sanitized string such as
* the output of \Drupal\Component\Utility\Xss::filter() or
* \Drupal\Component\Render\FormattableMarkup.
*
* @return $this
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment