PHP code example of in-square / pimcore-breadcrumbs

1. Go to this page and download the library: Download in-square/pimcore-breadcrumbs 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/ */

    

in-square / pimcore-breadcrumbs example snippets


use InSquare\PimcoreComponents\Breadcrumbs\Breadcrumbs;
use Pimcore\Model\Document;

public function defaultAction(Document $document, Breadcrumbs $breadcrumbs): Response
{
    $breadcrumbs->generateDocumentBreadcrumbs($document);

    return $this->render('default/default.html.twig');
}

$breadcrumbs
    ->generateDocumentBreadcrumbs($document)
    ->addItem($object->getName(), $objectUrl);