當前位置: 首頁>>代碼示例>>PHP>>正文


PHP widgets\Alert類代碼示例

本文整理匯總了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]);
 }
開發者ID:jedzura,項目名稱:nzs,代碼行數:9,代碼來源:PageController.php

示例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]);
 }
開發者ID:jedzura,項目名稱:nzs,代碼行數:13,代碼來源:GroupController.php

示例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]);
 }
開發者ID:jedzura,項目名稱:nzs,代碼行數:15,代碼來源:UserController.php

示例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">&copy; Feed-Cloud <?php 
echo date('Y');
?>
</p>

        <p class="pull-right"><?php 
開發者ID:vihanga-liyanage,項目名稱:feed-cloud,代碼行數:31,代碼來源:main.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)) {
    ?>
開發者ID:black-lamp,項目名稱:blcms-shop,代碼行數:31,代碼來源:add-video.php

示例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 
開發者ID:davidfang,項目名稱:yii2-adminlte,代碼行數:31,代碼來源:main.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 
開發者ID:aldegtyarev,項目名稱:fantasy,代碼行數:31,代碼來源:login-modal.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]);
 }
開發者ID:jedzura,項目名稱:nzs,代碼行數:20,代碼來源:SiteController.php


注:本文中的common\widgets\Alert類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。