Creitive\Breadcrumbs\Breadcrumbs::render PHP Method

render() public method

Renders the complete breadcrumbs into Twitter Bootstrap-compatible HTML.
public render ( ) : string
return string
    public function render()
    {
        if (empty($this->breadcrumbs)) {
            return '';
        }
        $cssClasses = implode(' ', $this->breadcrumbsCssClasses);
        return '<' . $this->listElement . ' itemscope itemtype="http://schema.org/BreadcrumbList"' . ' class="' . $cssClasses . '">' . $this->renderCrumbs() . '</' . $this->listElement . '>';
    }

Usage Example

 /**
  * Tests that no dividers are rendered if the divider is set to `null`.
  *
  * @dataProvider crumbsWithCssClassesProvider
  */
 public function testOutputWithoutDividers($crumbs, $classes)
 {
     $b = new Breadcrumbs($crumbs, $classes);
     $b->setDivider(null);
     $crawler = new Crawler($b->render());
     /**
      * There should be no `span.divider` elements present.
      */
     $this->assertCount(0, $crawler->filter('span.divider'));
 }
All Usage Examples Of Creitive\Breadcrumbs\Breadcrumbs::render