srdjan92/yii2-floating-menu

Floating menu with expand/collapse ability depending what is needed in specific case.

1.0.1 2019-02-10 22:17 UTC

This package is auto-updated.

Last update: 2025-05-11 15:58:13 UTC


README

Floating menu positioned at the left side of page with expand/collapse ability depending what is needed in specific case.

Instalation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist srdjan92/yii2-floating-menu "^1.0.0"

or add

"srdjan92/yii2-floating-menu": "^1.0.0"

to the require section of your composer.json file.

Usage

<?php

// basic example of floating widget

echo \srdjan\floatingmenu\FloatingMenu::widget([
    'toggleOptions' => [
        'collapseOptions' => ['class' => 'fal fa-arrow-alt-left'],
        'expandOptions' => ['class' => 'fal fa-arrow-alt-right']
    ],
    'items' => [
        [
            'url' => ['site/index'],
            'label' => "<i class='fal fa-envelope'></i> <span>Messages</span>"
        ],
        [
            'url' => ['/notification/index'],
            'label' => "<i class='fal fa-bell'></i> <span>Notifications</span>"
        ],
        [
            'url' => ['/account/profile'],
            'label' => "<i class='fal fa-user'></i> <span>Profile</span>"
        ],
        [
            'url' => ['/settings/disapprove'],
            'label' => "<i class='fal fa-users'></i> <span>Fans</span>"
        ],
        [
            'url' => ['/settings/approve'],
            'label' => "<i class='fal fa-user'></i> <span>Club</span>"
        ],
        [
            'url' => ['/settings/index'],
            'label' => "<i class='fal fa-cog'></i> <span>Settings</span>"
        ],
    ]
]); ?>

In example above are used fontawesome icons, feel free to use any icon library that fit your needs. Floating widget library does not have dependency on any icon library.