Inheritance: extends yii\bootstrap\Widget
Example #1
1
 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]);
 }
Example #2
0
 /**
  * @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]);
 }
Example #3
0
 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]);
 }
Example #4
0
    $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 
Example #5
0
 * @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)) {
    ?>
Example #6
0
</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 
Example #7
0
?>
			<?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 
Example #8
0
 /**
  * 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]);
 }