iserv4u/yii2-pii

A Yii2 widget and behavior to show and add content to a sidebar slideout panel.

0.1.8 2017-09-10 18:12 UTC

README

Yii2 Latest Stable Version Total Downloads License

What is this?

A sidebar panel, using a behavior to add any kind of elements from any object class.

Installation

Via composer:

composer require iserv4u/yii2-pii:*

Configuration

The Yii2 application config will be done automatically during composer boostrapping process

Output the panel

Simply add <?= \iserv4u\pii\widgets\PanelWidget::widget(); ?> in your layout or view.

Use the behavior

Add / register a item / element to the panel in any yii2 object

public function behaviors()
{
    return [
        'editor-panel' => [
            'class' => PanelBehavior::className(),
            'group' => self::className(),
            'item'  => [
                'view' => $this->render('@VIEW_PATH_ALIAS', ['param' => $value]),
                'options' => [
                    'class' => 'css-class'
                ]
            ]
        ]
    ];
}

or

$this->attachBehavior(
    'editor-panel' => [
        'class' => PanelBehavior::className(),
        'group' => self::className(),
        'item'  => [
            'view' => $this->render('@VIEW_PATH_ALIAS', ['param' => $value]),
            'options' => [
                'class' => 'css-class'
            ]
        ]
    ]
);

RBAC

Available Roles:

  • Pii-Editor

References

slideout.js - A touch slideout navigation menu for your mobile web apps.