Skip to content

An error has occurred resolving the options of the form "Symfony\Component\Form\Extension\Core\Type\UrlType": The option "placeholder" does not exist. #21294

@Dashoeferadmin

Description

@Dashoeferadmin

The documentation https://symfony.com/doc/current/reference/forms/types/url.html#empty-data says:

This will still render an empty text box, but upon submission the John Doe value will be set. Use the data or placeholder options to show this initial value in the rendered form.

But if i use it like this:
->add('website', UrlType::class, [ 'attr' => ['class' => 'form-control'], 'label'=>'registration.website', 'translation_domain' => 'forms', 'placeholder' => 'https://www.example.com' ])

Its end in

An error has occurred resolving the options of the form "Symfony\Component\Form\Extension\Core\Type\UrlType": The option "placeholder" does not exist. Defined options are: "action", "allow_extra_fields", "allow_file_upload", "attr", "attr_translation_parameters", "auto_initialize", "block_name", "block_prefix", "by_reference", "compound", "constraints", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_token_id", "csrf_token_manager", "data", "data_class", "default_protocol", "disabled", "empty_data", "error_bubbling", "error_mapping", "extra_fields_message", "form_attr", "getter", "help", "help_attr", "help_html", "help_translation_parameters", "inherit_data", "invalid_message", "invalid_message_parameters", "is_empty_callback", "label", "label_attr", "label_format", "label_html", "label_translation_parameters", "mapped", "method", "post_max_size_message", "priority", "property_path", "required", "row_attr", "setter", "translation_domain", "trim", "upload_max_size_message", "validation_groups".

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions