예제 #1
0
파일: FieldType.php 프로젝트: liamGreg/cmf
 public static function getFieldTypes()
 {
     $array = [];
     foreach (FieldType::find()->all() as $item) {
         $array[$item['id']] = $item['name'];
     }
     return $array;
 }
예제 #2
0
파일: Field.php 프로젝트: liamGreg/cmf
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFieldType()
 {
     return $this->hasOne(FieldType::className(), ['id' => 'type']);
 }
예제 #3
0
파일: _form.php 프로젝트: liamGreg/cmf
<div class="field-form">

    <?php 
$form = ActiveForm::begin();
?>

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

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

    <?php 
echo $form->field($model, 'type')->dropDownList(\backend\models\FieldType::getFieldTypes());
?>

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

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

    <?php 
echo $form->field($model, 'table_id')->dropDownList(\backend\models\Table::getTablesList());
?>

    <div class="form-group">