/** * Renders the widget. */ public function run() { if (Yii::$app->user->isGuest) { echo $this->render('navbaruser_logout'); } else { echo $this->render('navbaruser_login', array('type' => $this->type)); } AdminUiAsset::register($this->getView()); }
/** * Registers a specific Bootstrap plugin and the related events * @param string $name the name of the Bootstrap plugin */ protected function registerPlugin($name) { $view = $this->getView(); AdminUiAsset::register($view); $id = $this->options['id']; if ($this->clientOptions !== false) { $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions); $js = "jQuery('#{$id}').{$name}({$options});"; $view->registerJs($js); } if (!empty($this->clientEvents)) { $js = []; foreach ($this->clientEvents as $event => $handler) { $js[] = "jQuery('#{$id}').on('{$event}', {$handler});"; } $view->registerJs(implode("\n", $js)); } }
<?php use yii\helpers\Url; use yii\adminUi\assetsBundle\AdminUiAsset; use yii\helpers\Html; use common\models\extras\Broadcast; $bundle = AdminUiAsset::register($this); $home_uri = Url::home(true); ?> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-envelope"></i> <?php if (isset($notifications) && count($notifications) > 0) { echo '<span class="label label-success">' . count($notifications) . '</span>'; } ?> </a> <ul class="dropdown-menu"> <?php if (isset($notifications)) { ?> <li class="header">You have <?php echo count($notifications); ?> unread messages</li> <?php if (!empty($notifications)) { ?> <li> <ul class="menu">
/** * Renders the widget. */ public function run() { echo Html::tag('div', $this->renderButtons(), $this->options); AdminUiAsset::register($this->getView()); }
/** * Renders the widget. */ public function run() { echo Html::endTag('div'); $tag = ArrayHelper::remove($this->options, 'tag', 'nav'); echo Html::endTag($tag); AdminUiAsset::register($this->getView()); }
/** * Renders the widget. */ public function run() { echo $this->render('navbarnotification'); AdminUiAsset::register($this->getView()); }
use yii\adminUi\assetsBundle\AdminUiAsset; use yii\helpers\Html; use yii\adminUi\widget\Header; use yii\adminUi\widget\Nav; use yii\adminUi\widget\NavBar; use yii\adminUi\widget\NavBarUser; use yii\adminUi\widget\NavBarMessage; use yii\adminUi\widget\NavBarNotification; use yii\adminUi\widget\NavBarTask; use yii\widgets\Breadcrumbs; /** * @var \yii\web\View $this * @var string $content */ AppAsset::register($this); AdminUiAsset::register($this); $this->beginPage(); ?> <!DOCTYPE html> <html lang="<?php echo Yii::$app->language; ?> "> <head> <meta charset="<?php echo Yii::$app->charset; ?> "/> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <title><?php echo Html::encode($this->title);
/** * Renders the widget. */ public function run() { echo $this->render('navbarmessage'); AdminUiAsset::register($this->getView()); }
/** * Renders the widget. */ public function run() { echo Html::beginTag('div', $this->options) . "\n"; echo $this->renderProgress() . "\n"; echo Html::endTag('div') . "\n"; AdminUiAsset::register($this->getView()); }
/** * Renders the widget. */ public function run() { echo $this->renderItems(); AdminUiAsset::register($this->getView()); }