%s", implode(" ", [...$attributes]), lang("Product.label.{$field}")); break; } } //header.php에서 getFieldForm_Helper사용 function getFieldForm_ProductHelper($field, $value, array $fieldFormOptions, array $attributes = array()) { switch ($field) { case "category_uid": case "user_uid": $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Product.label.{$field}") . " 선택", ...$fieldFormOptions[$field]]; return form_dropdown($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes, 'class' => "select-field"]); // foreach ($fieldFormOptions[$field] as $key => $label) { // $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, is_array($value) ? [...$value] : [$value]), $attributes) . $label; // } // return implode(" ", $checkboxs); // return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]); break; case "status": $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Product.label.{$field}") . " 선택", ...$fieldFormOptions[$field]]; return form_dropdown($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], $attributes); break; case 'updated_at': case 'created_at': return form_input($field, $value, [...$attributes, 'class' => 'calender']); break; case 'passwd': return sprintf( "%s %s %s", form_password($field, DEFAULTS['EMPTY'], [...$attributes]), lang("Product.label.confirmpassword"), form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]), ); break; case 'head': case 'tail': case 'content': return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']); break; case 'photo': case 'upload_file': return form_upload($field); break; case 'name': return form_input($field, $value, [...$attributes, "placeholder" => "예) HP-DL360G6...", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]); break; case 'cost': case 'price': case 'sale': case 'stock': return form_input($field, $value, [...$attributes, 'type' => 'number']); break; default: return form_input($field, $value, [...$attributes]); break; } } // function getFieldView_ProductHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array()) { $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { case 'category_uid': $categorys = array(); foreach (array_values($fieldFormOptions[$field]) as $category_2depth) { foreach ($category_2depth as $key => $label) { $categorys[$key] = $label; } } return $categorys[$value]; break; case 'name': return sprintf( "