本文整理匯總了PHP中Alert::widget方法的典型用法代碼示例。如果您正苦於以下問題:PHP Alert::widget方法的具體用法?PHP Alert::widget怎麽用?PHP Alert::widget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Alert
的用法示例。
在下文中一共展示了Alert::widget方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model app\models\news\news */
$this->title = 'Редактирование новости';
$this->params['breadcrumbs'][] = ['label' => 'Справочники', 'url' => ['/admin']];
$this->params['breadcrumbs'][] = ['label' => 'Новости', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Редактировать';
if (Yii::$app->session->hasFlash('error')) {
echo Alert::widget(['type' => Alert::TYPE_DANGER, 'title' => 'Ошибка редактирования', 'icon' => 'glyphicon glyphicon-remove-sign', 'body' => Yii::$app->session->getFlash('error'), 'showSeparator' => true, 'delay' => 4000]);
}
?>
<div class="row">
<div class="col-xs-12 col-xs-offset-0 col-sm-offset-1 col-sm-10 news-update">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model, 'tournaments' => $tournaments]);
?>
</div>
</div>
示例2:
use kartik\widgets\DatePicker;
use app\models\RequestType;
use yii\helpers\ArrayHelper;
use app\models\Staff;
/* @var $this yii\web\View */
/* @var $model app\models\RequestDic */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
$RequestType = RequestType::find()->all();
$arraytype = ArrayHelper::map($RequestType, 'type_id', 'request_name');
$Staff = Staff::find()->all();
$arrayStaff = ArrayHelper::map($Staff, 'staff_id', 'name');
if (isset($erros)) {
echo Alert::widget(['options' => ['class' => 'alert-info'], 'body' => $erros]);
}
?>
<div class="request-dic-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'req_type_id')->dropDownList($arraytype, ['prompt' => '--Select--']);
?>
<?php
示例3:
<?php
use yii\web\View;
use yii\bootstrap\alert;
?>
<div class="bankrupt-default-index">
<h1><?php
echo Yii::t('app', 'Шаг 2: Выберите СРО');
?>
</h1>
<div>
<?php
echo Alert::widget(['options' => ['class' => 'alert-info'], 'body' => 'Страница находится в разработке ...']);
?>
</div>
<div>
Здесь пока пусто
</div>
</div>