php \Yii::$app->getSession()->setFlash('error', 'Alert! Danger alert preview. This alert is dismissable.'); Multiple messages could be set as follows: php \Yii::$app->getSession()->setFlash('error', ['Error 1', 'Error 2']);
Author: Evgeniy Tkachenko (et.coder@gmail.com)
Inheritance: extends yii\bootstrap\Widget
示例#1
0
 /**
  * Initializes the widget.
  * This method will register the bootstrap asset bundle. If you override this method,
  * make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $session = Yii::$app->getSession();
     $flashes = $session->getAllFlashes();
     $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : '';
     foreach ($flashes as $type => $data) {
         if (isset($this->alertTypes[$type])) {
             $data = (array) $data;
             foreach ($data as $message) {
                 $this->options['class'] = $this->alertTypes[$type]['class'] . $appendCss;
                 $this->options['id'] = $this->getId() . '-' . $type;
                 echo BootstrapAlert::widget(['body' => $this->alertTypes[$type]['icon'] . $message, 'closeButton' => $this->closeButton, 'options' => $this->options]);
             }
             //$session->removeFlash($type);
         }
     }
 }
示例#2
0
echo $this->render('header.php', ['directoryAsset' => $directoryAsset]);
?>

<?php 
echo $this->render('left.php', ['directoryAsset' => $directoryAsset]);
?>
<div class="content-wrapper">
    <section class="content-header">
        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
    </section>

    <section class="content">
        <?php 
echo Alert::widget();
?>
        <?php 
echo $content;
?>
    </section>
</div>

<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b>Version</b> 2.0
    </div>
    <strong>Copyright &copy; 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights
    reserved.
</footer>
示例#3
0
        echo $this->context->module->id !== \Yii::$app->id ? '<small>Module</small>' : '';
    }
    ?>
            </h1>
        <?php 
}
?>

        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
    </section>

    <section class="content">
        <?php 
echo Alert::widget(['options' => ['class' => 'animate-hide']]);
?>
        <?php 
echo $content;
?>
    </section>
</div>

<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b>Version</b> 1.0
    </div>
    <strong>Copyright &copy; <?php 
echo Yii::$app->formatter->asDate('now', 'php:Y');
?>
 <a href="https://github.com/nhatzbulawan/easypos"><?php 
<?php

/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var \app\models\Page $searchModel
 */
use kartik\dynagrid\DynaGrid;
$this->title = Yii::t('app', 'Pages');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo \dmstr\widgets\Alert::widget(['id' => 'alert']);
?>


<?php 
$this->beginBlock('buttonGroup');
?>
<div class="btn-toolbar" role="toolbar">
    <div class="btn-group">
        <?php 
echo \yii\helpers\Html::a('<i class="fa fa-plus"></i> ' . Yii::t('app', 'Add'), ['/admin-pages/edit'], ['class' => 'btn btn-success']);
?>
    </div>

</div>
<?php 
$this->endBlock();
?>
示例#5
0
        echo $this->context->module->id !== \Yii::$app->id ? '<small>Module</small>' : '';
    }
    ?>
            </h1>
        <?php 
}
?>

        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
    </section>

    <section class="content">
        <?php 
Alert::widget();
?>
        <?php 
echo $content;
?>
    </section>
</div>

<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b>Version</b> 2.0
    </div>
    <strong>&copy; <?php 
echo Yii::powercorp();
?>
  <?php 
示例#6
0
            <h1>
                <small><?php 
echo $this->title;
?>
</small>
            </h1>
            <?php 
echo \yii\widgets\Breadcrumbs::widget(['homeLink' => ['label' => 'Backend', 'url' => ['/backend']], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
        </section>

        <!-- Main content -->

        <section class="content">
            <?php 
echo Alert::widget(['isAjaxRemoveFlash' => false]);
?>
            <?php 
echo $this->blocks['twig-main-top'];
?>
            <?php 
echo $content;
?>
            <?php 
echo $this->blocks['twig-main-bottom'];
?>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">