本文整理汇总了PHP中common\widgets\Alert类的典型用法代码示例。如果您正苦于以下问题:PHP Alert类的具体用法?PHP Alert怎么用?PHP Alert使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Alert类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex($url)
{
$model = Page::findOne(['url' => $url]);
if (!$model) {
Alert::add('Strona nie została znaleziona', Alert::TYPE_ERROR);
return $this->goHome();
}
return $this->render('index', ['model' => $model]);
}
示例2: actionIndex
/**
* @param string $url
* @return string
*/
public function actionIndex($url)
{
$model = Group::findOne(['url' => $url]);
if (!$model) {
Alert::add(Yii::t('msg', 'Page not found.'), Alert::TYPE_ERROR);
return $this->goHome();
}
return $this->render('index', ['model' => $model]);
}
示例3: actionUpdate
public function actionUpdate($id = null)
{
/** @var User $model */
$model = User::findOne(Yii::$app->user->getIdentity()->id);
$model->setScenario('update');
if ($model->load(Yii::$app->request->post())) {
if ($model->newPassword) {
$model->setPassword($model->newPassword);
}
if ($model->save()) {
Alert::add(Yii::t('msg', 'Operation completed successfully.'));
}
}
return $this->render('update', ['model' => $model]);
}
示例4: date
$menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
$menuItems[] = ['label' => 'My Account', 'url' => ['/user/index']];
$menuItems[] = ['label' => 'Logout(' . Yii::$app->session->get('user.name') . ')', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']];
}
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menuItems]);
NavBar::end();
?>
<div class="container">
<?php
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
<?php
echo Alert::widget();
?>
<?php
echo $content;
?>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-left">© Feed-Cloud <?php
echo date('Y');
?>
</p>
<p class="pull-right"><?php
示例5:
* @var $video_form ProductVideo
* @var $video_form_upload ProductVideoForm
*/
use bl\cms\shop\backend\components\form\ProductVideoForm;
use bl\cms\shop\common\entities\Product;
use bl\cms\shop\common\entities\ProductVideo;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
?>
<br>
<!--ALERT WIDGET-->
<?php
echo \common\widgets\Alert::widget(['options' => ['class' => 'alert-fade']]);
?>
<table class="col-md-12 table-bordered table-condensed table-stripped table-hover">
<thead class="thead-inverse">
<tr>
<th class="text-center" colspan="4">
<h2><?php
echo \Yii::t('shop', 'Video');
?>
</h2>
</th>
</tr>
<?php
if (!empty($product->videos)) {
?>
示例6: isset
</small>
<?php
}
?>
</h1>
<?php
echo Breadcrumbs::widget(['homeLink' => ['label' => '<i class="fa fa-dashboard"></i> ' . Yii::t('app', 'Home'), 'url' => ['/']], 'encodeLabels' => false, 'tag' => 'ol', 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
</section>
<!-- Main content -->
<section class="content">
<div class="box box-primary">
<div class="box-body">
<?php
echo \common\widgets\Alert::widget();
?>
<?php
echo $content;
?>
</div>
</div>
</section><!-- /.content -->
</div>
<?php
$this->endBody();
?>
</body>
</html>
<?php
示例7:
?>
<?php
echo $form->field($model, 'rememberMe')->checkbox();
?>
<?php
echo Html::a(Yii::t('app', 'LoginForm_fogot_password'), ['site/request-password-reset'], ['class' => 'login-modal-fogot-pass']);
?>
<div class="clr"></div>
</div>
<?php
ActiveForm::end();
?>
<?php
echo Alert::widget(['closeButton' => ['tag' => 'a', 'label' => ' ']]);
?>
<?/*
<div class="body-error">
<h3>Неверный пароль</h3>
<a href="#" class="close"></a>
</div>
*/?>
<div class="body-login">
<span><?php
echo Yii::t('app', 'LoginForm_not_reg');
?>
</span>
<a href="<?php
示例8: actionResetPassword
/**
* Resets password.
*
* @param string $token
* @return mixed
* @throws BadRequestHttpException
*/
public function actionResetPassword($token)
{
try {
$model = new ResetPasswordForm($token);
} catch (InvalidParamException $e) {
throw new BadRequestHttpException($e->getMessage());
}
if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) {
Alert::add(Yii::t('msg', 'New password was saved. Now you can log in.'));
return $this->goHome();
}
return $this->render('resetPassword', ['model' => $model]);
}