本文整理汇总了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>