Download the PHP package skylineos/yii-menu without Composer
On this page you can find all versions of the php package skylineos/yii-menu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download skylineos/yii-menu
More information about skylineos/yii-menu
Files in skylineos/yii-menu
Package yii-menu
Short Description Yii2 extention for creating and managing menus
License BSD-3-Clause
Informations about the package yii-menu
Yii2 Menu
Installation
Composer:
"skylineos/yii-menu": "~1.0"
Run Migrations:
php yii migrate/up --migrationPath=vendor/skylineos/yii-menu/src/migrations
It is recommended though in no way required you create a migration in your own app to link the properties
createdBy
andmodifiedBy
as foreign keys to the primary keys of your User model (whatever that may be).
Once configured (below), you should be able to access the manager at /menu/menu/index
Configuration
config/web.php
Defining Link Targets
Targets (defining what the menu items can link to) can be handled three ways, all within the 'targets' property of the module:
Usage
This package comes with a helper widget that will process your menu and render it using whatever templates you've configured on your menu items.
Make sure your templates (menuTemplates
and dropDownTemplates
) meet the requirements. See Building Templates
If these requirements do not suit your needs, you are, of course, more than welcome to develop your own widget that renders the items however you like.
<?= \skylineos\yii\menu\widgets\SkyMenuWidget::widget(['menuId' => $menuId]) ?>
Where $menuId
is the id
of the Menu you wish to render.
Building Templates
Menu Templates:
See examples/MenuTemplate.php
in this repository
DropDown Templates:
See examples/DropDownTemplate.php
in this repository