PHP code example of yceruto / breadcrumbs-bundle

1. Go to this page and download the library: Download yceruto/breadcrumbs-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yceruto / breadcrumbs-bundle example snippets



// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Yceruto\Bundle\BreadcrumbsBundle\BreadcrumbsBundle(),
        );
    }

    // ...
}

public function indexAction() 
{
	$breadcrumbs = $this->get('breadcrumbs_builder')->create();
	$breadcrumbs->add('/', 'home');
	
	// or
	
	$node = new BreadcrumbsNode();
	$node->setPath('/')
	$node->setLabel('home')
	$breadcrumbs->addNode($node);
	
	return $this->render('index.html.twig', array('custom_breadcrumbs' => $breadcrumbs))
}