getSortedBuilders example

return TRUE;
  }

  /** * {@inheritdoc} */
  public function build(RouteMatchInterface $route_match) {
    $breadcrumb = new Breadcrumb();
    $context = ['builder' => NULL];
    // Call the build method of registered breadcrumb builders,     // until one of them returns an array.     foreach ($this->getSortedBuilders() as $builder) {
      if (!$builder->applies($route_match)) {
        // The builder does not apply, so we continue with the other builders.         continue;
      }

      $breadcrumb = $builder->build($route_match);

      if ($breadcrumb instanceof Breadcrumb) {
        $context['builder'] = $builder;
        break;
      }
      
Home | Imprint | This part of the site doesn't use cookies.