getAttribute('table')}.{$field}]" : ""; break; case "status": $rule = "required|trim|string"; break; default: $rule = parent::getFormRule($action, $field); break; } return $rule; } public function getFormOption(string $action, string $field, array $formDatas = [], array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array { $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; switch ($field) { case 'lineinfo_uid': foreach ($this->getFormOption_process(service('equipment_lineservice'), $action, $field, $formDatas) as $tempEntity) { $tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle(); // $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())]; } $options['options'] = $tempOptions; break; case 'old_clientinfo_uid': foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $formDatas) as $tempEntity) { $tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle(); // $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $tempEntity->getRole())]; } // dd($tempOptions); $options['options'] = $tempOptions; break; default: $options = parent::getFormOption($action, $field, $formDatas, $options); break; } return $options; } }