PHP code example of prime / navigation-bundle

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

    

prime / navigation-bundle example snippets

 php

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Prime\NavigationBundle\PrimeNavigationBundle(),
    );
}

 php


// src/AppBundle/Navigation/MainNavigation.php

namespace AppBundleBundle\Navigation;


class MainNavigation
{

    public function build()
    {
        return array(
            array(
                'label' => 'Page #1',
                'route' => 'route_homepage'
            ),
            array(
                'label' => 'Page #2',
                'route' => 'route_page',
                'routeParameters => array('slug' => 'page_2')
            ),
        );
    }
}