src/Builders/ViewsBuilder.php
private function buildCreateForm()
    {
        $form = '';
        foreach ($this->fields as $field) {
            $title = addslashes($field->label);
            $key   = $field->title;
            if (in_array($field->validation, $this->starred)) {
                $title .= '*';
            }
            if ($field->type == 'relationship') {
                $key = $field->relationship_name . '_id';
            }
            $temp = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $field->type);
            $temp = str_replace([
                '$LABEL$',
                '$TITLE$',
                '$VALUE$',
                '$STATE$',
                '$SELECT$',
                '$TEXTEDITOR$',
                '$HELPER$',
                '$WIDTH$',
                '$HEIGHT$',
            ], [
                $key,
                $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->formFieldsCreate = $form;
    }
private function buildCreateForm()
    {
        $form = '';
        foreach ($this->fields as $field) {
            $title = addslashes($field->label);
            $key   = $field->title;
            if (in_array($field->validation, $this->starred)) {
                $title .= '*';
            }
            if ($field->type == 'relationship') {
                $key = $field->relationship_name . '_id';
            }
            $temp = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $field->type);
            $temp = str_replace([
                '$LABEL$',
                '$TITLE$',
                '$VALUE$',
                '$STATE$',
                '$SELECT$',
                '$TEXTEDITOR$',
                '$HELPER$',
                '$WIDTH$',
                '$HEIGHT$',
            ], [
                $key,
                $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->formFieldsCreate = $form;
    }
private function buildCreateForm ( ) { $ form = '' ; foreach ( $ this -> fields as $ field ) { $ title = addslashes ( $ field -> label ) ; $ key = $ field -> title ; if ( in_array ( $ field -> validation , $ this -> starred ) ) { $ title .= '*' ; } if ( $ field -> type == 'relationship' ) { $ key = $ field -> relationship_name . '_id' ; } $ temp = file_get_contents ( __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $ field -> type ) ; $ temp = str_replace ( [ '$LABEL$' , '$TITLE$' , '$VALUE$' , '$STATE$' , '$SELECT$' , '$TEXTEDITOR$' , '$HELPER$' , '$WIDTH$' , '$HEIGHT$' , ] , [ $ key , $ 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 -> formFieldsCreate = $ form ; }
Build create.blade.php form
Build create . blade . php form