Skip to content
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

Partial rendering of RadioList is very strict to default value #76

Closed
janedbal opened this issue Apr 14, 2015 · 3 comments
Closed

Partial rendering of RadioList is very strict to default value #76

janedbal opened this issue Apr 14, 2015 · 3 comments

Comments

@janedbal
Copy link

This form definition

$form->addRadioList('test', 'Test', [
    '1' => "one",
    '2' => "two",    
]);
$form->setDefaults(['test' => '1']);

with following rendering

{foreach ['1', '2'] as $key}
    {input test:$key}
    {label test:$key /}
{/foreach}

will not check the default radiolist value due to strict comparison here. Maybe the $key might be fixed by the same trick as used here. What do you think?


Example is quite artificial, but when the arrays are generated somewhere, it is not so obvious what is happening...

@dg
Copy link
Member

dg commented Apr 14, 2015

Can you send PR or failing test?

@janedbal
Copy link
Author

Sure.

@dg
Copy link
Member

dg commented Apr 14, 2015

Thanks

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

No branches or pull requests

2 participants