PHP code example of spiffy / spiffy-navigation

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

    

spiffy / spiffy-navigation example snippets


     'SpiffyNavigation',
     



// module.config.php
return array(
    'spiffy_navigation' => array(
        'containers' => array(
            'default' => array(
                array(
                    'options' => array(
                        'uri' => 'http://www.github.com',
                    ),
                    'attributes' => array(
                        'class'  => 'foo',
                        'target' => '_blank',
                        'name'   => 'github'
                    )
                ),
                array(
                    'options' => array(
                        'label' => 'Home',
                        'route' => 'home',
                    ),
                    'attributes' => array(
                        'name' => 'Home'
                    )
                    'pages' => array(
                        // ...
                    )
                )
            ),

            'serviceManager' => 'My\ServiceManager\Alias',

            'class' => 'My\Class\Instantiation',

            'json_provider' => 'mynav',
        ),

        'providers' => array(
            'mynav' => array(
                'type' => 'json',
                'options' => array(
                    'json' => file_get_contents(__DIR__ . '/navigation/mynav.json')
                )
            )
        )
    )
);



echo $this->helperName('containerName');



// in view script
echo $this->navigationMenu('containerName');

// or

echo $this->navigationMenu()->renderMenu('containerName', $options);

// or

echo $this->navigationMenu()->renderPartial('containerName', 'partialName');