dmstr / yii2-adminlte-asset

AdminLTE Asset Bundle for Backend Theme in Yii2 Framework
1.14k stars 425 forks source link

menu's options #198

Closed xiaoyixiang closed 4 years ago

xiaoyixiang commented 4 years ago

Hello,thinks for your yii2-adminlte-asset , I am using it,My callback function is like this

$callback = function($menu){
    $data = Json::decode($menu['data'], true);
    return [
        'label' => $menu['name'],
        'url' => [$menu['route']],
        'options' => $data,
        'items' => $menu['children'],
    ];
};

but it‘’s seem to not work, the style in HTML is class="fa fa-circle-o",and I try to debug , found that there are never used options ($data) in Menu class, so when I try to like below,

$callback = function($menu){
    $data = Json::decode($menu['data'], true);
    return [
        'label' => $menu['name'],
        'url' => [$menu['route']],
        'icon' => $data['icon'],
        'visible' => $data['visible'],
        'items' => $menu['children'],
    ];
};

it work! but it looks different from the README.md. Is there anything wrong with my usage? please

githubjeka commented 4 years ago

Hello, can not understand anything. Please provide stack of errors or other information instead of words "it'’s seem to not work,"