Exemplo n.º 1
0
<div class="dashboard-create">

    <?php 
$form = ActiveForm::begin(['id' => 'dashboard-form', 'enableClientValidation' => false, 'errorSummaryCssClass' => 'alert alert-danger error-summary']);
?>

    <?php 
echo $form->errorSummary($model);
?>

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'layout_class')->dropDownList(array_flip(Module::getInstance()->layouts), ['prompt' => '']);
?>

    <?php 
echo $form->field($model, 'sort')->textInput();
?>

    <?php 
echo $form->field($model, 'enabled')->checkbox();
?>

    <?php 
echo Html::submitButton('<span class="fa fa-check"></span> ' . Yii::t('dashboard', 'Create'), ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-success']);
?>

    <?php 
Exemplo n.º 2
0
 /**
  * @return Connection
  */
 public static function getDb()
 {
     return Module::getInstance()->getDb();
 }