Breadcrumb::setLinks

public Breadcrumb::setLinks(array $links)

Sets the breadcrumb links.

Parameters

\Drupal\Core\Link[] $links: The breadcrumb links.

Return value

$this

Throws

\LogicException Thrown when setting breadcrumb links after they've already been set.

File

core/lib/Drupal/Core/Breadcrumb/Breadcrumb.php, line 44

Class

Breadcrumb
Used to return generated breadcrumbs with associated cacheability metadata.

Namespace

Drupal\Core\Breadcrumb

Code

public function setLinks(array $links) {
  if (!empty($this->links)) {
    throw new \LogicException('Once breadcrumb links are set, only additional breadcrumb links can be added.');
  }

  $this->links = $links;

  return $this;
}
doc_Drupal
2016-10-29 08:48:42
Comments
Leave a Comment

Please login to continue.