Ejemplo n.º 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());
 }
Ejemplo n.º 2
0
 /**
  * @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]);
 }
Ejemplo n.º 3
0
 /**
  * @return bool
  */
 public function save()
 {
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }
Ejemplo n.º 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>