示例#1
0
 /**
  * @return bool
  */
 public function save($validate = true)
 {
     if ($validate && !$this->validate()) {
         return false;
     }
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }
 /**
  * @return string
  */
 public function actionIndex()
 {
     $module = Module::getInstance();
     /* @var $model \app\modules\admhidemenu\models\SettingsForm */
     $model = $module->manager->createSettingsForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->save()) {
             Yii::$app->getSession()->setFlash('success', Adm::t('', 'Data successfully changed!'));
             return Adm::redirect(['index']);
         }
     }
     return $this->render('index', ['model' => $model]);
 }
示例#3
0
 /**
  * @return bool
  */
 public function save()
 {
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }
示例#4
0
                ?>
                                <?php 
                echo $form->field($model, 'items[' . $child['key'] . ']', ['template' => '{input}{label}'])->label($child['label'])->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
                ?>
                            </div>
                        <?php 
            }
            ?>
                    <?php 
        }
        ?>
                <?php 
    }
    ?>
            </div>
        <?php 
}
?>
    </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>