내가 원하는 것을 할 수 있습니까? add method
의 세 번째 매개 변수는 같은 predifined 옵션의 배열 인양식 작성 도구 추가 방법에 대한 사용자 지정 옵션 만들기
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('field', null, array_of_options)
;
}
:
내가 어떻게 양식 필드를 만들 것을 알고 label
, attr
, 등등 ... 당신은 같은 것을 할 경우 :
$builder
->add('field', null, array('my_option' => 'my value'));
이 오류를 얻을 것이다 :
The option "my_option" does not exist. Known options are: "action", "attr", "auto_initialize", "block_name", "by_reference", "cascade_validation", "compound", "constraints", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_provider", "data", "data_class", "disabled", "empty_data", "error_bubbling", "error_mapping", "extra_fields_message", "grouping", "inherit_data", "intention", "invalid_message", "invalid_message_parameters", "label", "label_attr", "mapped", "max_length", "method", "pattern", "post_max_size_message", "precision", "property_path", "read_only", "required", "rounding_mode", "translation_domain", "trim", "validation_groups", "virtual"
나는 this을 읽고 이해해 왔지만, 내가 찾던 것이 아니다. 컨트롤러에서 createForm
메서드의 옵션을 전달하고 싶지 않습니다.
내가 원하는 것은 에 세 번째 매개 변수의 배열에 대한 사용자 지정 option
을 만드는 것입니다.
죄송합니다.