PHP code example of osw3 / symfony-breadcrumb

1. Go to this page and download the library: Download osw3/symfony-breadcrumb 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/ */

    

osw3 / symfony-breadcrumb example snippets

 
// config/bundles.php

return [
    // ...
    OSW3\Breadcrumb\BreadcrumbBundle::class => ['all' => true],
];
 
class ProductController extends AbstractController
{
    #[Route('/products', name: 'app_product')]
    #[Breadcrumb([['label' => "Products", 'route' => "app_product"]])]
    public function index(): Response
    {
        // ...
    }
}
 
class BookController extends AbstractController
{
    #[Route('/books', name: 'app_books')]
    #[Breadcrumb([
        ['label' => "Products", 'route' => "app_product"]
        ['label' => "Books", 'route' => "app_books"]
    ])]
    public function index(): Response
    {
        // ...
    }
}