PHP code example of mix8872 / yii2-menu

1. Go to this page and download the library: Download mix8872/yii2-menu 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/ */

    

mix8872 / yii2-menu example snippets


'modules' => [
    'menu' => [
        'class' => 'mix8872\menu\Module',
        'on menuAfterCreate' => static function ($e) {
            $model = $e->model;
            // ... do something
        },
        'on menuAfterDelete' => static function ($e) {
            $model = $e->model;
            // ... do something
        },
        'on menuAfterUpdate' => static function ($e) {
            $model = $e->model;
            // ... do something
        },
        'on menuAfterSort' => static function ($e) {
            $model = $e->model;
            // ... do something
        },
        'on menuAfterAddItem' => static function ($e) {
            $model = $e->model;
            // ... do something
        },
        'on menuAfterDeleteItem' => static function ($e) {
            $model = $e->model;
            // ... do something
        },
    ],
    // ... other modules definition
],


<?= \mix8872\menu\widgets\MenuWidget::widget([
        'code' => 'Tx1rNy'
    ])