コード例 #1
0
 /**
  * @return string
  */
 public function actionIndex()
 {
     $module = Module::getInstance();
     /* @var $model \app\modules\admgoogletools\models\SettingsForm */
     $model = $module->manager->createSettingsForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if ($model->save()) {
             Yii::$app->getSession()->setFlash('success', Adm::t('', 'Data successfully changed!'));
             return Adm::redirect(['index']);
         }
     }
     return $this->render('index', ['model' => $model]);
 }
コード例 #2
0
ファイル: index.php プロジェクト: pavlinter/yii2-app-core
                </div>
            </div>
            <div class="col-xs-12 col-sm-6 col-md-6">
                <div>
                    <?php 
echo $form->field($model, 'webtools')->textarea();
?>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12">
                <div>
                    <?php 
echo $form->field($model, 'active', ["template" => "{input}\n{label}\n{hint}\n{error}"])->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
?>
                </div>
            </div>
        </div>

        <p>
            <?php 
echo InputButton::widget(['label' => !isset(Yii::$app->params[Module::getInstance()->settingsKey]) ? Adm::t('', 'Create', ['dot' => false]) : Adm::t('', 'Update', ['dot' => false]), 'options' => ['class' => 'btn btn-primary'], 'input' => 'adm-redirect', 'name' => 'redirect', 'formSelector' => $form]);
?>

        </p>
    <?php 
ActiveForm::end();
?>
</div>
コード例 #3
0
 /**
  * @return bool
  */
 public function save()
 {
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }
コード例 #4
0
ファイル: base.php プロジェクト: pavlinter/yii2-adm-app
<?php

use app\helpers\Url;
use yii\helpers\Html;
/**
 * @var \yii\web\View $this
 * @var string $content
 */
\app\modules\admgoogletools\Module::loadGoogleTools();
\app\modules\admlivechat\Module::loadLiveChat();
if (Yii::$app->params['html.canonical'] === true) {
    $this->registerLinkTag(['rel' => 'canonical', 'href' => Url::canonical()]);
} else {
    if (Yii::$app->params['html.canonical'] !== false) {
        $this->registerLinkTag(['rel' => 'canonical', 'href' => Yii::$app->params['html.canonical']]);
    }
}
if (!in_array(Yii::$app->controller->getRoute(), ['site/login', 'site/signup', 'site/request-password-reset', 'site/reset-password', 'site/user-approve'])) {
    Url::remember(Url::current());
}
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
">
<head>
    <meta charset="<?php 
echo Yii::$app->charset;
?>