Skip to content

Update checkbox.rst // no checked option #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2013
Merged

Update checkbox.rst // no checked option #357

merged 1 commit into from
Nov 29, 2013

Conversation

gabriel-kaam
Copy link
Contributor

Salut !

En comparant avec la version anglaise
http://symfony.com/doc/master/reference/forms/types/checkbox.html on remarque que l'option checked n'existe pas (plus?).

Je viens de tester le code suivant

$builder->add('remember_me', 'checkbox',
            array(
                'checked' => true,
                )
            )

Et effectivement, Symfony me renvoie une erreur:

The option "checked" 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", "inherit_data", "intention", "invalid_message", "invalid_message_parameters", "label", "label_attr", "mapped", "max_length", "method", "pattern", "post_max_size_message", "property_path", "read_only", "required", "translation_domain", "trim", "validation_groups", "value", "virtual"

Salut !

En comparant avec la version anglaise
http://symfony.com/doc/master/reference/forms/types/checkbox.html on remarque que l'option checked n'existe pas (plus?).

Je viens de tester le code suivant

$builder->add('_remember_me', 'checkbox',
            array(
                'checked' => true,
                )
            )

Et effectivement, Symfony me renvoie une erreur:
The option "checked" does not exist.
@gabriel-kaam
Copy link
Contributor Author

Pour info , voici bonne manière de rendre une checkbox cochée par défaut

$builder->add('remember_me', 'checkbox',
            array(
                'data' => 1,
                )
            )

gregquat added a commit that referenced this pull request Nov 29, 2013
Update checkbox.rst // no checked option
@gregquat gregquat merged commit 38cce3d into symfony-fr:master Nov 29, 2013
@gregquat
Copy link
Member

Merci bien, effectivement, je ne sais pas d'où ça vient. Je suppose que si ça y est ça devait être d'actualité à une époque (surement une vieille version). Dans tous les cas merci.

gregquat added a commit that referenced this pull request Nov 29, 2013
@gabriel-kaam gabriel-kaam deleted the patch-1 branch December 10, 2013 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants