PHP code example of rrd108 / cakephp-menulink

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

    

rrd108 / cakephp-menulink example snippets


Plugin::load('MenuLink');

$this->loadHelper('MenuLink.MenuLink');

$this->MenuLink->menuLink(
    'Link text',
    [
        'controller' => 'posts', 
        'action' => 'index'
    ],
    [$options]
);

$this->loadHelper('Html', ['className' => 'MenuLink.MenuLink']);

$this->Html->menuLink(
    'Link text',
    [
        'controller' => 'posts', 
        'action' => 'index'
    ],
    [$options]
);