php yii-bootstrap-NavBar类(方法)实例源码

下面列出了php yii-bootstrap-NavBar 类(方法)源码代码实例,从而了解它的用法。

作者:mark3    项目:yii2-to   
public function run()
 {
     NavBar::begin(['brandLabel' => false, 'options' => ['class' => 'tor-nav']]);
     echo Html::tag('div', $this->torMenu(), ['class' => 'container']);
     NavBar::end();
     $view = $this->view;
     NavAsset::register($view);
 }

作者:mark3    项目:yii2-to   
public function run()
 {
     NavBar::begin(['brandLabel' => false, 'options' => ['class' => 'top-nav']]);
     echo NavX::widget(['items' => $this->topMenu(), 'options' => ['class' => 'nav navbar-nav navbar-left nav-pills main-nav'], 'encodeLabels' => false]);
     echo NavX::widget(['items' => $this->accountMenu(), 'options' => ['class' => 'nav navbar-nav navbar-right nav-pills account-top-nav'], 'encodeLabels' => false]);
     NavBar::end();
     $view = $this->view;
     NavAsset::register($view);
 }

作者:ochie    项目:app-cm   
/**
  * Renders mini-toolbar at the end of page body.
  *
  * @param \yii\base\Event $event
  */
 public function renderToolbar($event)
 {
     /* @var $view View */
     /* @var $urlManagerBack \yii\web\UrlManager */
     $urlManagerBack = Yii::$app->urlManagerBack;
     $view = $event->sender;
     $view->registerCss($view->renderPhpFile(__DIR__ . '/assets/toolbar.min.css'));
     NavBar::begin(['id' => 'wd-frontend-toolbar', 'brandLabel' => Html::img('@web/img/logo-mini.png'), 'brandUrl' => $urlManagerBack->baseUrl, 'innerContainerOptions' => ['class' => 'container-fluid'], 'options' => ['class' => 'navbar navbar-inverse navbar-fixed-top']]);
     echo Nav::widget(['encodeLabels' => false, 'options' => ['class' => 'navbar-nav'], 'items' => [['label' => '<span aria-hidden="true" class="glyphicon glyphicon-dashboard"></span> ' . Option::get('sitetitle'), 'items' => [['label' => Yii::t('toolbar', 'Dashboard'), 'url' => $urlManagerBack->baseUrl], ['label' => Yii::t('toolbar', 'Themes'), 'url' => $urlManagerBack->createUrl(['/theme']), 'visible' => Yii::$app->user->can('administrator')], ['label' => Yii::t('toolbar', 'Menus'), 'url' => $urlManagerBack->createUrl(['/menu']), 'visible' => Yii::$app->user->can('administrator')], ['label' => Yii::t('toolbar', 'Modules'), 'url' => $urlManagerBack->createUrl(['/module']), 'visible' => Yii::$app->user->can('administrator')], ['label' => Yii::t('toolbar', 'Widgets'), 'url' => $urlManagerBack->createUrl(['/widget']), 'visible' => Yii::$app->user->can('administrator')]]], ['label' => '<span aria-hidden="true" class="glyphicon glyphicon-plus"></span> ' . Yii::t('toolbar', 'New'), 'items' => $this->getAddNewMenu() ? $this->getAddNewMenu() : null]]]);
     echo Nav::widget(['encodeLabels' => false, 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => '<span aria-hidden="true" class="glyphicon glyphicon-user"></span> ' . Yii::$app->user->identity->username, 'items' => [['label' => 'Profile', 'url' => $urlManagerBack->createUrl(['/user/profile'])], ['label' => 'Logout', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']]]]]]);
     NavBar::end();
 }

作者:pc-brain    项目:blit   
public function getMenu()
 {
     $isAdmin = !Yii::$app->user->isGuest ? Yii::$app->user->identity->can('editor') : false;
     $canAdmin = !Yii::$app->user->isGuest ? Yii::$app->user->identity->can('editor') : false;
     $networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
     $menuItems = [['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], ['label' => 'Contact', 'url' => ['/site/contact']]];
     if (Yii::$app->user->isGuest) {
         $menuItems[] = ['label' => Yii::t('user', 'Sign up'), 'url' => ['/user/registration/register']];
         $menuItems[] = ['label' => Yii::t('user', 'Sign in'), 'url' => ['/user/security/login']];
     } else {
         $menuItems['user'] = ['label' => $isAdmin ? Yii::$app->user->identity->profile->fullname . ' (admin)' : Yii::$app->user->identity->profile->fullname, 'items' => [['label' => Yii::t('user', 'Profile'), 'url' => ['/user/settings/profile']], ['label' => Yii::t('user', 'Account'), 'url' => ['/user/settings/account']], ['label' => Yii::t('user', 'Networks'), 'url' => ['/user/settings/networks'], 'visible' => $networksVisible], '<li class="divider"></li>', ['label' => Yii::t('user', 'Logout'), 'url' => ['/user/security/logout'], 'linkOptions' => ['data-method' => 'post']]]];
     }
     if ($canAdmin) {
         $menuItems['user']['items'][] = '<li class="divider"></li>';
         $menuItems['user']['items'][] = ['label' => Yii::t('user', 'Admin Panel'), 'url' => Yii::$app->urlManagerBackEnd->createUrl('')];
     }
     NavBar::begin(['brandLabel' => Yii::$app->params['companyName'], 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
     echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menuItems]);
     NavBar::end();
 }

作者:ivphpa    项目:iri   
?>
</title>
    <?php 
$this->head();
?>
</head>
<body>
<?php 
$this->beginBody();
?>

<div class="wrap">
    <?php 
NavBar::begin(['brandLabel' => \Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => 'События', 'items' => [['label' => 'Категории', 'url' => ['/article/category']], ['label' => 'Список', 'url' => ['/article/events']]]], ['label' => 'Каталог', 'items' => [['url' => ['/catalog/category'], 'label' => 'Категории'], ['url' => ['/catalog/brand'], 'label' => 'Бренды']]], ['label' => 'Настройки', 'url' => ['/settings/settings']], Yii::$app->user->isGuest ? ['label' => 'Login', 'url' => ['/site/login']] : ['label' => 'Logout (' . Yii::$app->user->identity->username . ')', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']]]]);
NavBar::end();
?>

    <div class="container">
        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
        <?php 
echo $content;
?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; <?php

作者:ezsk    项目:yii2-platform-cor   
$this->head();
?>
</head>
<body>
<?php 
$this->beginBody();
\yii\bootstrap\NavBar::begin(['brandLabel' => Yii::$app->siteName, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
$items = [['label' => '<i class="glyphicon glyphicon-home"></i> ' . Yii::t('gromver.platform', 'Home'), 'url' => Yii::$app->homeUrl]];
if (Yii::$app->user->can('administrate')) {
    $items[] = ['label' => '<i class="glyphicon glyphicon-cog"></i> ' . Yii::t('gromver.platform', 'Admin Panel'), 'url' => ['/main/backend/default/index']];
}
if (Yii::$app->request->referrer) {
    $items[] = ['label' => '<i class="glyphicon glyphicon-step-backward"></i> ' . Yii::t('gromver.platform', 'Back'), 'url' => Yii::$app->request->referrer];
}
echo \yii\bootstrap\Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'encodeLabels' => false, 'items' => $items]);
\yii\bootstrap\NavBar::end();
?>

<div class="wrap">
    <div class="container">
        <?php 
echo \yii\widgets\Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
        <?php 
foreach (Yii::$app->session->getAllFlashes() as $type => $body) {
    echo \kartik\widgets\Alert::widget(['type' => $type, 'body' => $body]);
}
?>
        <?php 
echo $content;
?>

作者:bolom00    项目:Yii2-API_RESful-CRUD-Relation   
?>
    <title><?php 
echo Html::encode($this->title);
?>
</title>
    <?php 
$this->head();
?>
</head>
<body>
    <?php 
$this->beginBody();
?>
    <div class="wrap">
        <?php 
NavBar::begin(['brandLabel' => 'Woo Soft', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
?>











                <div class="main-content">
                    <?php 
echo $content;

作者:barie    项目:yii2-module-cms-modul   
public function actionMenu()
 {
     NavBar::begin(['brandLabel' => Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse', 'style' => 'z-index: 9999;']]);
     echo MenuWidget::widget(['direction' => 'left', 'options' => ['class' => 'navbar-nav navbar-right']]);
     NavBar::end();
 }

作者:semn    项目:tp0   
public function init()
 {
     if ($this->brandGlyphicon) {
         $this->brandLabel = Html::glyphicon($this->brandGlyphicon) . $this->brandLabel;
     }
     parent::init();
 }


问题


面经


文章

微信
公众号

扫码关注公众号