php yii-widgets-Breadcrumbs类(方法)实例源码

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

作者:hiqde    项目:hipanel-cor   
public function addBreadcrumbs()
    {
        $view = Yii::$app->getView();
        // No need to add breadcrumbs, if they are completely empty
        if (!isset($view->params['breadcrumbs'])) {
            return null;
        }
        $header = Html::tag('h1', $view->title . ($view->params['subtitle'] ? Html::tag('small', $view->params['subtitle']) : ''));
        $breadcrumbs = Breadcrumbs::widget(['homeLink' => ['label' => '<i class="fa fa-dashboard"></i> ' . Yii::t('hipanel', 'Home'), 'url' => '/'], 'encodeLabels' => false, 'tag' => 'ol', 'links' => isset($view->params['breadcrumbs']) ? $view->params['breadcrumbs'] : []]);
        $content = Json::htmlEncode(Html::tag('section', $header . $breadcrumbs, ['class' => 'content-header']));
        Yii::$app->getView()->registerJs(new JsExpression(<<<JS
            \$('.content-header li a').on('click', function (event) {
                var container = \$('#{$this->id}');
                \$.pjax.click(event, {container: container});
            });
            \$('.content-header').replaceWith({$content});
JS
), \yii\web\View::POS_READY);
    }

作者:cinghi    项目:yii2-admin-lt   
public function init()
 {
     if ($this->title === null) {
         $this->title = 'Dashboard';
     }
     if ($this->subtitle === null) {
         $this->subtitle = '<small>Version 2.0</small>';
     } elseif ($this->subtitle != '') {
         $this->subtitle = '<small>' . Html::encode($this->subtitle) . '</small>';
     }
     if ($this->breadcrumbs === null) {
         $this->breadcrumbs = '<ol class="breadcrumb">
             <li><a href="#">Home</a></li>
             <li class="active">Dashboard</li>
         </ol>';
     } elseif ($this->breadcrumbs === []) {
         $this->breadcrumbs = '<ol class="breadcrumb">
             <li><pre>SET $this[params]->breadcrumbs</pre></li>
         </ol>';
     } else {
         $this->breadcrumbs = Breadcrumbs::widget(['links' => $this->breadcrumbs]);
     }
 }

作者:Liv102    项目:cm   
/**
     * Initializes the widget.
     * This renders the form open tag.
     */
    public function init()
    {
        $breadcrumbs = \yii\widgets\Breadcrumbs::widget(['homeLink' => ['label' => \Yii::t("yii", "Home"), 'url' => ['admin/index', 'namespace' => 'admin']], 'links' => isset(\Yii::$app->view->params['breadcrumbs']) ? \Yii::$app->view->params['breadcrumbs'] : []]);
        $alert = \skeeks\cms\modules\admin\widgets\Alert::widget();
        $actions = \Yii::$app->view->params['actions'];
        echo <<<HTML
        <div class="main">
            <div class="col-lg-12">
                <div class="panel panel-primary sx-panel sx-panel-content">
                    <div class="panel-heading sx-no-icon">
                        <h2>
                            {$breadcrumbs}
                        </h2>
                        <div class="panel-actions"></div>
                    </div><!-- End .panel-heading -->
                    <div class="panel-body">
                            <div class="panel-content-before">
                                {$actions}
                            </div>
                            <div class="panel-content">
                                    {$alert}

HTML;
    }

作者:eje    项目:yii2-app-advance   
<section class="content-header">
        <?php 
if (isset($this->params['header'])) {
    ?>
            <h1><?php 
    echo $this->params['header'];
    ?>
</h1>
        <?php 
}
?>
        <?php 
if (isset($this->params['breadcrumbs'])) {
    ?>
        <?php 
    echo Breadcrumbs::widget(['options' => ['class' => 'breadcrumb'], 'encodeLabels' => false, 'homeLink' => ['label' => '<i class="fa fa-dashboard"></i> Главная', 'url' => ['/site/index']], 'links' => $this->params['breadcrumbs']]);
    ?>
        <?php 
}
?>
    </section>

        <?php 
if (isset($this->params['toolbar'])) {
    echo '<div class="content-header">';
    foreach ($this->params['toolbar'] as $button) {
        echo $button . "&nbsp;&nbsp;";
    }
    echo '</div>';
}
?>

作者:heartshar    项目:yii2-burivu   
<?php

use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use zabachok\burivuh\assets\BurivuhAsset;
BurivuhAsset::register($this);
$this->registerJs('burivuh.view.init();');
echo Breadcrumbs::widget(['links' => isset($breadcrumbs) ? $breadcrumbs : [], 'homeLink' => false]);
?>

<?php 
echo $this->render('_panel', ['model' => $model]);
?>
<div class="row">
    <div class="col-md-12">
        <h2><?php 
echo Yii::t('burivuh', 'Hot keys');
?>
</h2>
        <span class="label label-default">Ctrl</span> + <span class="label label-default">e</span> - <?php 
echo Yii::t('burivuh', 'edit the document');
?>
<br>
    </div>
</div>

作者:agungsuprayitn    项目:sm   
$iduser = $an['ID'];
        $nama = $an['NAMA'];
        $email = $an['EMAIL'];
    }
} else {
    $iduser = '';
    $nama = "";
    $email = "";
}
?>
                <!-- Main content -->
                <section class="content">
                	 <div class="col-md-12">
				      <h5>
				        <?php 
echo Breadcrumbs::widget(['itemTemplate' => "<li><b>{link}</b></li>\n", 'links' => [['label' => 'User Management', 'url' => [''], 'template' => "<li><b>{link}</b></li>\n"]]]);
?>
				      </h5>
				    </div>
			<table><div id="form_user">
			<input type="hidden" name="iduser" id="iduser" value="<?php 
echo $iduser;
?>
">
		<tr><td>Nama</td><td><input type="text" class="form-control" id="nama" name="nama" size="50" value=""/></td>
		<td width="50"></td><td>Password</td><td><input type="text" class="form-control" id="pass" name="pass"  value="" size="50"/></td>
		</tr>
		<tr><td>Nik</td><td><input type="text" class="form-control" id="nik" name="nik"  value=""  size="50"/></td>
		<td width="50"></td><td>Access</td>
		<td><input type="checkbox" name="dsb" id="dsb" value="DSB"> Dashboard <input type="checkbox" id="scc" name="scc" value="SCC"> Scalling Campaign 
		<input type="checkbox" name="suc" id="suc" value="SUC"> Sustaining Campaign</td></tr>

作者:zinchenkoma    项目:moneychange   
//        $menuItems[] = ['label' => 'Зарегистрироваться', 'url' => ['/site/signup']];
//        $menuItems[] = ['label' => 'Войти', 'url' => ['/site/login']];
//    } else {
//        $menuItems[] = [
//            'label' => 'Выйти (' . Yii::$app->user->identity->username . ')',
//            'url' => ['/site/logout'],
//            'linkOptions' => ['data-method' => 'post']
//        ];
//    }
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menuItems]);
NavBar::end();
?>

    <div class="container">
        <?php 
echo Breadcrumbs::widget(['homeLink' => ['label' => 'Главная', 'url' => '/'], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
        <?php 
echo Alert::widget();
?>
        <?php 
echo $content;
?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; Меняла <?php 
echo date('Y');
?>

作者:hoang    项目:AwsProjec   
/* @var $this yii\web\View */
/* @var $searchModel backend\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>

<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
    <?php 
echo Html::encode($this->title);
?>
</h3>
<div class="page-bar">
    <?php 
echo Breadcrumbs::widget(['itemTemplate' => "<li>{link}<i class='fa fa-angle-right'></i></i></li>\n", 'activeItemTemplate' => "<li>{link}</li>\n", 'options' => ['class' => 'page-breadcrumb'], 'homeLink' => ['label' => Yii::t('backend', 'Home'), 'url' => Yii::$app->homeUrl, 'template' => "<li><i class='fa fa-home'></i>{link}<i class='fa fa-angle-right'></i></li>\n"], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row">
    <div class="col-md-12">
        <?php 
echo Alert::widget();
?>
        <!-- Begin: life time stats -->
        <div class="user-index portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <?php 
echo Html::encode($this->title);

作者:jcabanilla    项目:yii2-inspini   
echo $this->blocks['content-header'];
    ?>
                    <?php 
} else {
    ?>
                        <div class="col-sm-<?php 
    echo isset($this->blocks['content-header-actions']) ? 6 : 12;
    ?>
">
                            <h2><?php 
    echo $this->title;
    ?>
</h2>

                            <?php 
    echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 'activeItemTemplate' => "<li class=\"active\"><strong>{link}</strong></li>\n"]);
    ?>
                        </div>
    <?php 
    if (isset($this->blocks['content-header-actions'])) {
        ?>
                            <div class="col-sm-6">
                                <div class="title-action">
        <?php 
        echo $this->blocks['content-header-actions'];
        ?>
                                </div>
                            </div>
                        <?php 
    }
}

作者:wuxing16    项目:tuanlog   
use backend\models\ErrorLogSearch;
use yii\grid\GridView;
use yii\widgets\Pjax;
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use yii\widgets\ActiveForm;
use backend\services\LogTypeService;
?>
<div class="row">
    <div id="breadcrumb" class="col-xs-12">
        <a href="#" class="show-sidebar">
            <i class="fa fa-bars"></i>
        </a>
        <ol class="breadcrumb pull-left">
            <?php 
echo Breadcrumbs::widget(['itemTemplate' => "<li>{link}</li>\n", 'links' => [['label' => '错误信息', 'url' => ['/ajax/error/index'], 'class' => 'ajax-link']]]);
?>
        </ol>
        <div id="social" class="pull-right">
            <?php 
/**
 <a href="#"><i class="fa fa-google-plus"></i></a>
 <a href="#"><i class="fa fa-facebook"></i></a>
 <a href="#"><i class="fa fa-twitter"></i></a>
 <a href="#"><i class="fa fa-linkedin"></i></a>
 <a href="#"><i class="fa fa-youtube"></i></a>
* 
*/
?>
        </div>
    </div>

作者:James8    项目:www.yii2.co   
<?php

/*
 * @author Lmy
 * QQ:6232967
 * Create at 2015-12-24 11:09:21
 */
echo \yii\widgets\Breadcrumbs::widget(['homeLink' => ['label' => '首页', 'url' => yii\helpers\Url::to(['site/index']), 'template' => '<div class="weizhi-zt">您现在的位置:{link}'], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 'options' => ['class' => 'weizhi'], 'tag' => 'div', 'itemTemplate' => ' &gt; {link}', 'activeItemTemplate' => ' &gt; {link}']) . "</div>";
?>

作者:wuxing16    项目:tuanlog   
<?php

use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use yii\widgets\ActiveForm;
use backend\services\LogTypeService;
use yii\helpers\Url;
?>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            自定义日志
        </h1>
        <?php 
echo Breadcrumbs::widget(['tag' => 'ol', 'itemTemplate' => "<li>{link}</li>\n", 'links' => [['label' => '日志列表', 'url' => ['/ajax/customlog/index']]]]);
?>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">增加自定义日志</h3>
                        <div class="box-tools">
                            <ul class="pagination pagination-sm no-margin pull-right">
                                <li><a href="<?php 
echo Url::toRoute('/ajax/customlog/add');
?>
"><i class="fa fa-fw fa-plus"></i></a></li>
                            </ul>

作者:davidfan    项目:yii2-adminlt   
<?php 
echo $this->title;
?>
                <?php 
if (isset($this->params['subtitle'])) {
    ?>
                    <small><?php 
    echo $this->params['subtitle'];
    ?>
</small>
                <?php 
}
?>
            </h1>
            <?php 
echo Breadcrumbs::widget(['homeLink' => ['label' => '<i class="fa fa-dashboard"></i> ' . Yii::t('app', 'Home'), 'url' => ['/']], 'encodeLabels' => false, 'tag' => 'ol', 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="box box-primary">
                <div class="box-body">
                    <?php 
echo \common\widgets\Alert::widget();
?>
                    <?php 
echo $content;
?>
                </div>
            </div>

作者:zabacho    项目:yii2-burivu   
<?php

use yii\widgets\Breadcrumbs;
$this->title = Yii::t('burivuh', 'History of document: {title}', ['title' => $model->title]);
$breadcrumbs = array_merge($model->getBreadcrumbs(1), ['label' => Yii::t('burivuh', 'History')]);
echo Breadcrumbs::widget(['links' => $breadcrumbs, 'homeLink' => ['label' => Yii::t('burivuh', 'Root'), 'url' => ['/burivuh/category/index']]]);
$callback = \Yii::$app->getModule('burivuh')->usernameCallback;
?>
<h1><?php 
echo $this->title;
?>
</h1>
<table class="table">
    <tr>
        <th><?php 
echo Yii::t('burivuh', 'Date');
?>
</th>
        <th><?php 
echo Yii::t('burivuh', 'Title');
?>
</th>
        <th><?php 
echo Yii::t('burivuh', 'Diff');
?>
</th>
        <th><?php 
echo Yii::t('burivuh', 'User');
?>
</th>
        <th></th>

作者:goncharovl    项目:keyword   
<body>

<?php 
$this->beginBody();
?>
    <div class="wrap">
        <?php 
//TODO переделать меню под нормальный вид
NavBar::begin(['brandLabel' => 'MYKEYWORDS.RU', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => 'Главная', 'url' => ['/site/index'], 'visible' => Yii::$app->user->isGuest], ['label' => 'О нас', 'url' => ['/site/about'], 'visible' => Yii::$app->user->isGuest], ['label' => 'Контакты', 'url' => ['/site/contact'], 'visible' => Yii::$app->user->isGuest], ['label' => 'Пользователи', 'url' => ['/user/admin/'], 'visible' => Yii::$app->user->identity && Yii::$app->user->identity->isAdmin()], ['label' => 'Профиль', 'url' => ['/user/default/profil/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Изменить пароль', 'url' => ['/user/default/change-password/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Задания', 'url' => ['/tasks/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Тикеты', 'url' => ['/ticket/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Финансы', 'url' => ['/financy/'], 'visible' => !Yii::$app->user->isGuest], Yii::$app->user->isGuest ? ['label' => 'Регистрация', 'url' => ['/user/default/signup']] : '', Yii::$app->user->isGuest ? ['label' => 'Авторизация', 'url' => ['/user/default/login']] : ['label' => 'Выход (' . Yii::$app->user->identity->username . ')', 'url' => ['/user/default/logout'], 'linkOptions' => ['data-method' => 'post']]]]);
NavBar::end();
?>

        <div class="container">
            <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) && !Yii::$app->user->isGuest ? $this->params['breadcrumbs'] : []]);
?>

            <?php 
Alert::widget();
?>

            <?php 
echo $content;
?>

        </div>
    </div>

    <footer class="footer">
        <div class="container">

作者:bessonov8    项目:b   
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
            <!-- beauty_up_adapt -->
            <ins class="adsbygoogle"
                 style="display:block"
                 data-ad-client="ca-pub-6721896084353188"
                 data-ad-slot="9892796747"
                 data-ad-format="auto"></ins>
            <script>
                (adsbygoogle = window.adsbygoogle || []).push({});
            </script>
        </div>
        <div id="content">

            <?php 
echo Breadcrumbs::widget(['itemTemplate' => '<span>{link}</span>', 'activeItemTemplate' => '<span class="breadcrumbs_active">{link}</span>', 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 'options' => ['class' => 'breadcrumbs'], 'tag' => 'div']);
?>





            <?php 
echo AdvertWidget::widget(['block_number' => 4]);
?>





            <!-- Таблица контент-->

作者:unix-admi    项目:profitda   
?>

<div class="wrap">
    <?php 
NavBar::begin(['options' => ['class' => 'navbar-inverse navbar-top']]);
if (Yii::$app->user->isGuest) {
    echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-top'], 'items' => [['label' => 'Login', 'url' => ['/admin/default/login']]]]);
} else {
    echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-top'], 'items' => [['label' => 'Logout (' . Yii::$app->user->identity->username . ')', 'url' => ['/admin/default/logout'], 'linkOptions' => ['data-method' => 'post']], ['label' => 'Керування користувачами', 'url' => ['/admin/admins/index']], ['label' => 'Керування контентом', 'url' => ['/admin/content/index']], ['label' => 'Керування учасниками та компаніями', 'url' => ['/admin/company/index']], ['label' => 'Керування подіями', 'url' => ['/admin/events/index']], ['label' => 'Керування розсилками', 'url' => ['/admin/mail/index']]]]);
}
NavBar::end();
?>

    <div class="container">
        <?php 
echo Breadcrumbs::widget([]);
?>
        <?php 
echo $content;
?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; My Company <?php 
echo date('Y');
?>
</p>

        <p class="pull-right"><?php

作者:xidia    项目:gxfenx   
echo '<div class="box-body"><div class="alert alert-danger alert-dismissable"><i class="icon fa fa-ban"></i>' . Yii::$app->getSession()->getFlash('danger') . 'danger<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button></div></div>';
} elseif (Yii::$app->getSession()->hasFlash('info')) {
    echo '<div class="box-body"><div class="alert alert-info alert-dismissable"><i class="icon fa fa-info"></i>' . Yii::$app->getSession()->getFlash('info') . 'info<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button></div></div>';
} elseif (Yii::$app->getSession()->hasFlash('warning')) {
    echo '<div class="box-body"><div class="alert alert-warning alert-dismissable"><i class="icon fa fa-warning"></i>' . Yii::$app->getSession()->getFlash('warning') . 'warning<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button></div></div>';
} elseif (Yii::$app->getSession()->hasFlash('success')) {
    echo '<div class="box-body"><div class="alert alert-success alert-dismissable"><i class="icon fa fa-check"></i>' . Yii::$app->getSession()->getFlash('success') . 'success<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button></div></div>';
}
?>

            <!-- Content Header (Page header) -->
            <section class="content-header">
                <?php 
if (isset($this->params['breadcrumbs'])) {
    $params = ['tag' => 'ol', 'encodeLabels' => false, 'homeLink' => ['label' => '<i class="fa fa-dashboard"></i>' . Yii::t('common', 'Home'), 'url' => Yii::$app->homeUrl], 'links' => $this->params['breadcrumbs']];
    echo Breadcrumbs::widget($params);
}
?>
            </section>
            <!-- Main content -->
            <section class="content">
                <a name="home" id="mark_home"></a>
                <?php 
echo $content;
?>
            </section>
            <!-- /.content -->
        </div>

        <!-- /.content-wrapper -->
        <footer class="main-footer">

作者:sevensenc    项目:iisn   
<?php 
echo Yii::t('app', 'Help');
?>
                            </span>
                                <span class="menu-hover"></span>
                            </a>
                        </li>
                    </ul>
                </div><!-- /main-menu -->
            </div>
            <!-- /sidebar-inner -->
        </aside>
        <div id="main-container">
            <div id="breadcrumb">
                <?php 
echo Breadcrumbs::widget(['homeLink' => ['label' => Yii::t('app', 'Home'), 'url' => ['/user/dashboard']], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
            </div><!-- /breadcrumb-->

            <div class="padding-md">
                <?php 
echo Alert::widget();
?>
                <div class="container-fluid">
                    <?php 
echo $content;
?>
                </div>
            </div><!-- /.padding-md -->
        </div>
        <footer>

作者:tqsq200    项目:dotplant   
<?php 
echo ThemeParts::renderPart('before-content');
?>
            <div class="container">
                <div class="row">
                    <?php 
if (!empty($leftSidebar)) {
    echo '<div class="left-sidebar col-md-' . $leftSidebarLength . ' col-xs-12">' . $leftSidebar . '</div>';
}
?>
                    <div class="content-part col-md-<?php 
echo $contentLength;
?>
 col-xs-12">
                    <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 'options' => ['itemprop' => "breadcrumb", 'class' => 'breadcrumb']]);
?>
                    <?php 
echo Alert::widget();
?>
                    <?php 
echo $content;
?>
                    </div> <!-- content-part end -->

                    <?php 
if (!empty($rightSidebar)) {
    echo '<div class="right-sidebar col-md-' . $rightSidebarLength . ' col-xs-12">' . $rightSidebar . '</div>';
}
?>
                </div> <!-- /row -->


问题


面经


文章

微信
公众号

扫码关注公众号