0) { foreach($data[1] as $key=>$attr) { // $params 에서 찾기 if(isset($params[$attr])) { $args[$key] = $params[$attr]; } // 모델에서 찾기 if(property_exists($model, $attr)) { $args[$key] = $model->{$attr}; } // request 에서 찾기 if(request()->has($attr)) { $args[$key] = request()->get($attr, ''); } } } return route($data[0], $args); } return route($data); }; $htmls = []; if(property_exists($model, 'form')) { $form = $model->form; $htmls[] = FormFacade::model($model, ['id'=>'form', 'route'=>$form['action'], 'files' => true]); $inputs = $model->inputs; $rows = []; foreach($inputs as $name => $element) { $rowHtml = []; $rowHtml['label'] = ''; $rowHtml['html'] = ''; // hidden if($name == '#') { $rowHtml['hidden'] = $element; $rows[] = $rowHtml; continue; } // custom view else if(Str::startsWith($name, '@')) { $rowHtml['view'] = $element; $rows[] = $rowHtml; continue; } $type = 'text'; if(isset($element['type'])) $type = $element['type']; $rowHtml['label'] = FormFacade::label($name, $element['label']); if($type == 'text') $rowHtml['html'] = FormFacade::text($name, null, array_merge(['class'=>'form-control'], isset($element['attrs'])?$element['attrs']:[])); else if($type == 'textarea') $rowHtml['html'] = FormFacade::textarea($name, null, array_merge(['class'=>'form-control'], isset($element['attrs'])?$element['attrs']:[])); else if($type == 'select') $rowHtml['html'] = FormFacade::select($name, $element['data'], null, array_merge(['class'=>'form-control'], isset($element['attrs'])?$element['attrs']:[])); else if($type == 'radio') { $radioLables = []; $radioHtmls = []; if(isset($element['data'])) { $no = 0; foreach($element['data'] as $value => $text) { $id = $name.'-'.($no++); $radioLables[] = FormFacade::label($id, $text, ['class'=>'custom-control-label']); $radioHtmls[] = FormFacade::radio($name, $value, null, array_merge(['id'=>$id, 'class'=>'custom-control-input'], isset($element['attrs'])?$element['attrs']:[])); } } $radioHtml = []; foreach($radioLables as $index=>$label) { $radioHtml[] = sprintf('