Laraveldaily\Quickadmin\Builders\ViewsBuilder::buildEditForm PHP Метод

buildEditForm() приватный Метод

Build edit.blade.php form
private buildEditForm ( )
    private function buildEditForm()
    {
        $form = '';
        foreach ($this->fields as $field) {
            $title = addslashes($field->label);
            $label = $field->title;
            if (in_array($field->validation, $this->starred) && $field->type != 'password' && $field->type != 'file' && $field->type != 'photo') {
                $title .= '*';
            }
            if ($field->type == 'relationship') {
                $label = $field->relationship_name . '_id';
            }
            if ($field->type == 'checkbox') {
                $field->default = '$' . $this->model . '->' . $label . ' == 1';
            }
            $temp = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $field->type);
            $temp = str_replace(['old(\'$LABEL$\')', '$LABEL$', '$TITLE$', '$VALUE$', '$STATE$', '$SELECT$', '$TEXTEDITOR$', '$HELPER$', '$WIDTH$', '$HEIGHT$'], ['old(\'$LABEL$\',$' . $this->resource . '->' . $label . ')', $label, $title, $field->type != 'radio' ? $field->value != '' ? ', "' . $field->value . '"' : '' : "'{$field->value}'", $field->default, '$' . $field->relationship_name, $field->texteditor == 1 ? ' ckeditor' : '', $this->helper($field->helper), $field->dimension_w, $field->dimension_h], $temp);
            $form .= $temp;
        }
        $this->formFieldsEdit = $form;
    }