8000 GitHub - bigfishtv/magicmenu
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bigfishtv/magicmenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magicmenu

Installation

composer require bigfishtv/magicmenu

Usage

AppView.php

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

[your-view].[ctp|php]

$items = [
    ['title' => 'About', 'url' => '/about'],
    ['title' => 'Work', 'url' => '/work', 'children' => [
        ['title' => 'One', 'url' => '/work/one'],
        ['title' => 'Two', 'url' => '/work/two'],
        ['title' => 'Three & Four', 'url' => '/work/three-and-four'],
    ]],
    ['title' => 'Contact', 'url' => '/contact']
];
$menu = $this->MagicMenu->create($items);
echo $menu->render();

Output

<ul>
    <li>
        <a href="/about">
            <span>About</span>
        </a>
    </li>
    <li>
        <a href="/work">
            <span>Work</span>
        </a>
        <ul>
            <li>
                <a href="/work/one">
                    <span>One</span>
                </a>
            </li>
            <li>
                <a href="/work/two">
                    <span>Two</span>
                </a>
            </li>
            <li>
                <a href="/work/three-and-four">
                    <span>Three &amp; Four</span>
                </a>
            </li>
        </ul>
    </li>
    <li>
        <a href="/contact">
            <span>Contact</span>
        </a>
    </li>
</ul>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0