当前位置: 首页>>代码示例>>PHP>>正文


PHP Option::getMenu方法代码示例

本文整理汇总了PHP中common\models\Option::getMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::getMenu方法的具体用法?PHP Option::getMenu怎么用?PHP Option::getMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common\models\Option的用法示例。


在下文中一共展示了Option::getMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

</p>
                    <?php 
    echo Html::a('<i class="fa fa-circle text-success"></i>' . Yii::t('writesdown', 'Online'), ['/user/profile']);
    ?>
                </div>
            </div>
        <?php 
}
?>

        <?php 
$adminSiteMenu[0] = ['label' => Yii::t('writesdown', 'MAIN NAVIGATION'), 'options' => ['class' => 'header'], 'template' => '{label}'];
$adminSiteMenu[1] = ['label' => Yii::t('writesdown', 'Dashboard'), 'icon' => 'fa fa-dashboard', 'items' => [['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Home'), 'url' => ['/site/index']]]];
$adminSiteMenu[10] = ['label' => Yii::t('writesdown', 'Media'), 'icon' => 'fa fa-picture-o', 'items' => [['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'All Media'), 'url' => ['/media/index']], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Add New Media'), 'url' => ['/media/create']], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Comments'), 'url' => ['/media-comment/index'], 'visible' => Yii::$app->user->can('editor')]], 'visible' => Yii::$app->user->can('author')];
$adminSiteMenu[20] = ['label' => Yii::t('writesdown', 'Appearance'), 'icon' => 'fa fa-paint-brush', 'items' => [['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Menus'), 'url' => ['/menu/index']], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Themes'), 'url' => ['/theme/index']], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Widgets'), 'url' => ['/widget/index']]], 'visible' => Yii::$app->user->can('administrator')];
$adminSiteMenu[23] = ['label' => Yii::t('writesdown', 'Modules'), 'icon' => 'fa fa-laptop', 'items' => [['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'All Modules'), 'url' => ['/module/index']], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Add New Module'), 'url' => ['/module/create']]], 'visible' => Yii::$app->user->can('administrator')];
$adminSiteMenu[30] = ['label' => Yii::t('writesdown', 'Post Types'), 'icon' => 'fa fa-files-o', 'items' => [['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'All Post Types'), 'url' => ['/post-type/index']], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Add New Post Type'), 'url' => ['/post-type/create']]], 'visible' => Yii::$app->user->can('administrator')];
$adminSiteMenu[40] = ['label' => Yii::t('writesdown', 'Taxonomies'), 'icon' => 'fa fa-tags', 'items' => [['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'All Taxonomies'), 'url' => ['/taxonomy/index']], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Add New Taxonomy'), 'url' => ['/taxonomy/create']]], 'visible' => Yii::$app->user->can('administrator')];
$adminSiteMenu[50] = ['label' => Yii::t('writesdown', 'Users'), 'icon' => 'fa fa-user', 'items' => [['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'All Users'), 'url' => ['/user/index'], 'visible' => Yii::$app->user->can('administrator')], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Add New User'), 'url' => ['/user/create'], 'visible' => Yii::$app->user->can('administrator')], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'My Profile'), 'url' => ['/user/profile'], 'visible' => Yii::$app->user->can('subscriber')], ['icon' => 'fa fa-circle-o', 'label' => Yii::t('writesdown', 'Reset Password'), 'url' => ['/user/reset-password'], 'visible' => Yii::$app->user->can('subscriber')]]];
$adminSiteMenu = ArrayHelper::merge($adminSiteMenu, PostType::getMenu(2));
$adminSiteMenu = ArrayHelper::merge($adminSiteMenu, Option::getMenu(60));
if (isset(Yii::$app->params['adminSiteMenu']) && is_array(Yii::$app->params['adminSiteMenu'])) {
    $adminSiteMenu = ArrayHelper::merge($adminSiteMenu, Yii::$app->params['adminSiteMenu']);
}
ksort($adminSiteMenu);
echo MainSidebar::widget(['items' => $adminSiteMenu]);
?>

    </section>
</aside>
开发者ID:tampaphp,项目名称:app-cms,代码行数:30,代码来源:main-sidebar.php

示例2:

                    <p><?php 
    echo Yii::$app->user->identity->username;
    ?>
</p>
                    <?php 
    echo Html::a('<i class="fa fa-circle text-success"></i>' . Yii::t('writesdown', 'Online'), ['/user/profile']);
    ?>
                </div>
            </div>
        <?php 
}
?>

        <?php 
$admin_site_menu[0] = ['label' => Yii::t('writesdown', 'MAIN NAVIGATION'), 'options' => ['class' => 'header'], 'template' => '{label}'];
$admin_site_menu[1] = ['label' => Yii::t('writesdown', 'Dashboard'), 'icon' => '<i class="fa fa-dashboard"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Home'), 'url' => ['/site/index']]]];
$admin_site_menu[10] = ['label' => Yii::t('writesdown', 'Media'), 'icon' => '<i class="fa fa-picture-o"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'All Media'), 'url' => ['/media/index']], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Add New Media'), 'url' => ['/media/create']], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Comments'), 'url' => ['/media-comment/index'], 'visible' => Yii::$app->user->can('editor')]], 'visible' => Yii::$app->user->can('author')];
$admin_site_menu[20] = ['label' => Yii::t('writesdown', 'Appearance'), 'icon' => '<i class="fa fa-paint-brush"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Menus'), 'url' => ['/menu']], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Themes'), 'url' => ['/theme']]], 'visible' => Yii::$app->user->can('administrator')];
$admin_site_menu[23] = ['label' => Yii::t('writesdown', 'Modules'), 'icon' => '<i class="fa fa-laptop"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'All Modules'), 'url' => ['/module']], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Add New Module'), 'url' => ['/module/create']]], 'visible' => Yii::$app->user->can('administrator')];
$admin_site_menu[30] = ['label' => Yii::t('writesdown', 'Post Types'), 'icon' => '<i class="fa fa-files-o"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'All Post Types'), 'url' => ['/post-type/index/']], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Add New Post Type'), 'url' => ['/post-type/create/']]], 'visible' => Yii::$app->user->can('administrator')];
$admin_site_menu[40] = ['label' => Yii::t('writesdown', 'Taxonomies'), 'icon' => '<i class="fa fa-tags"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'All Taxonomies'), 'url' => ['/taxonomy/index/']], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Add New Taxonomy'), 'url' => ['/taxonomy/create/']]], 'visible' => Yii::$app->user->can('administrator')];
$admin_site_menu[50] = ['label' => Yii::t('writesdown', 'Users'), 'icon' => '<i class="fa fa-user"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'All User'), 'url' => ['/user/index/'], 'visible' => Yii::$app->user->can('administrator')], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Add New User'), 'url' => ['/user/create/'], 'visible' => Yii::$app->user->can('administrator')], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'My Profile'), 'url' => ['/user/profile/'], 'visible' => Yii::$app->user->can('subscriber')], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Reset Password'), 'url' => ['/user/reset-password/'], 'visible' => Yii::$app->user->can('subscriber')]]];
$admin_site_menu[70] = ['label' => Yii::t('writesdown', 'Tools'), 'icon' => '<i class="fa fa-wrench"></i>', 'options' => ['class' => 'treeview'], 'items' => [['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Export'), 'url' => ['/site/not-found/'], 'visible' => Yii::$app->user->can('superadmin')], ['icon' => '<i class="fa fa-circle-o"></i>', 'label' => Yii::t('writesdown', 'Import'), 'url' => ['/site/not-found/'], 'visible' => Yii::$app->user->can('superadmin')]]];
$admin_site_menu = ArrayHelper::merge($admin_site_menu, PostType::getMenu(2));
$admin_site_menu = ArrayHelper::merge($admin_site_menu, Option::getMenu(60));
ksort($admin_site_menu);
echo MainSidebar::widget(['options' => ['class' => 'sidebar-menu'], 'labelTemplate' => '<a href="#">{icon}<span>{label}</span>{right-icon}{badge}</a>', 'linkTemplate' => '<a href="{url}">{icon}<span>{label}</span>{right-icon}{badge}</a>', 'submenuTemplate' => "\n<ul class=\"treeview-menu\">\n{items}\n</ul>\n", 'activateParents' => true, 'items' => $admin_site_menu]);
?>
    </section>
</aside>
开发者ID:wozhen,项目名称:yii2-cms-writedown,代码行数:30,代码来源:main-sidebar.php


注:本文中的common\models\Option::getMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。