本文整理汇总了PHP中yii\web\Session::getFlash方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::getFlash方法的具体用法?PHP Session::getFlash怎么用?PHP Session::getFlash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\web\Session
的用法示例。
在下文中一共展示了Session::getFlash方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
</div>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div>
<div class="row">
<?php
Pjax::begin();
?>
<div class="col-lg-9">
<div class="box">
<div class="box-header">
<h3 class="box-title">รายการใบสั่งงาน <span class="badge bg-yellow-active">
<?php
if (!empty($session->getFlash('msg'))) {
?>
<?php
echo $session->getFlash('msg');
?>
<?php
} else {
?>
All
<?php
}
?>
</span> </h3>
<div class="box-tools">
<ul class="pagination pagination-sm no-margin pull-right">
示例2:
$sale = new \backend\models\Saledata();
$country = new \backend\models\Country();
$saleorline = new \backend\models\Saleorderline();
// Yii::$app->params['uploadPath'] = realpath(Yii::$app->basePath) . '/uploads/icon/';
Yii::$app->params['uploadPath'] = '../../uploads/icon/';
// echo Yii::$app->params['uploadPath'];
?>
<?php
$form = ActiveForm::begin(['id' => 'myform', 'options' => ['class' => 'form-horizontal', 'enctype' => 'multipart/form-data']]);
?>
<div class="salenoid" <?php
echo "id={$model->recid}";
?>
></div>
<?php
if (!empty($session->getFlash('msgsuccess'))) {
?>
<div class="alert alert-success alert-dismissable" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<?php
echo $session->getFlash('msgsuccess');
?>
</div>
<?php
}
?>
<?php
if (!empty($session->getFlash('msgerror'))) {
?>
<div class="alert alert-danger alert-dismissable" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
示例3: Session
<?php
use yii\widgets\LinkPager;
use yii\web\Session;
$session = new Session();
$session->open();
?>
<div class="panel">
<div class="panel-body">
<h4>หนังสือรับ</h4>
<hr>
<?php
if (!empty($session->getFlash('message'))) {
?>
<div class="alert alert-success">
<i class="glyphicon glyphicon-ok"></i>
<?php
echo $session['message'];
?>
</div>
<?php
}
?>
<a href="index.php?r=book/form" class="btn btn-primary">
<i class="glyphicon glyphicon-plus"></i>
ลงหนังสือรับใหม่
</a>
示例4: getFlash
/**
* Returns a flash message.
* @param string $key the key identifying the flash message
* @param mixed $defaultValue value to be returned if the flash message does not exist.
* @param boolean $delete whether to delete this flash message right after this method is called.
* If false, the flash message will be automatically deleted in the next request.
* @return mixed the flash message
* @see setFlash()
* @see hasFlash()
* @see getAllFlashes()
* @see removeFlash()
*/
public function getFlash($key, $defaultValue = null, $delete = false)
{
$this->updateFlashCounters();
return parent::getFlash($key, $defaultValue, $delete);
// TODO: Change the autogenerated stub
}
示例5: Session
<?php
use yii\widgets\ActiveForm;
use yii\web\Session;
use yii\helpers\Html;
$session = new Session();
$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
if ($session->hasFlash('message')) {
?>
<div class="alert alert-danger" role="alert"><?php
echo $session->getFlash('message');
?>
</div>
<?php
}
?>
<div class="site-login">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>Please fill out the following fields to login:</p>
<?php
$form = ActiveForm::begin(['id' => 'login-form', 'options' => ['class' => 'form-horizontal'], 'fieldConfig' => ['template' => "{label}\n<div class=\"col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>", 'labelOptions' => ['class' => 'col-lg-1 control-label']]]);
?>
<?php
echo $form->field($login, 'usr')->label("Username");
示例6: Session
use yii\helpers\Html;
//use yii\grid\GridView;
use kartik\grid\GridView;
use yii\web\Session;
$session = new Session();
$session->open();
/* @var $this yii\web\View */
/* @var $searchModel backend\models\Car4Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'รายชื่อรถยนต์';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="car4-index">
<?php
if ($session->getFlash('msg')) {
?>
<div class="alert alert-success alert-dismissable" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<?php
echo $session->getFlash('msg');
?>
</div>
<?php
}
?>
<h3><?php
echo Html::encode($this->title);
?>
</h3>
<?php