コード例 #1
0
ファイル: index.php プロジェクト: frostiks25/rzwebsys7
?>

        <?php 
echo $form->field($model, 'modelClass')->widget(DependDropDown::className(), ["dependAttr" => "key", "source" => ["/import/admin/csv-import/keys"], "data" => $classes, "serverAttr" => "cls", "triggerChange" => true, "options" => ["class" => "form-control"]]);
?>

        <?php 
echo $form->field($model, 'filePath')->widget(\mihaildev\elfinder\InputFile::className(), ["template" => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', "options" => ["class" => "form-control"], "buttonOptions" => ["class" => "btn btn-default"]]);
?>

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

        <?php 
echo $form->field($model, 'key')->widget(DependDropDown::className(), ["options" => ["class" => "form-control"]]);
?>

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

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

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

        <?php 
コード例 #2
-1
 /**
  * Формирование Html кода поля для вывода в форме
  * @param ActiveForm $form объект форма
  * @param array $options массив html атрибутов поля
  * @param bool|int $index инднкс модели при табличном вводе
  * @return string
  */
 public function renderInput(ActiveForm $form, array $options = [], $index = false)
 {
     $options = ArrayHelper::merge($this->options, $options);
     $widgetOptions = ArrayHelper::merge(["options" => ["class" => "form-control", "prompt" => ""], "data" => $this->modelField->getDataValue()], $this->widgetOptions, ["options" => $options]);
     $attr = $this->modelField->attr;
     return $form->field($this->modelField->model, $this->getFormAttrName($index, $attr))->widget(DependDropDown::className(), $widgetOptions);
 }