Commit 2da22cf5 authored by Avris's avatar Avris

fix invalid characters in widget id

parent 7579faa8
......@@ -154,7 +154,7 @@ abstract class Widget
'{widget_class}' => '',
'{extra}' => '',
'{has_error}' => count($this->messages) ? 'has-error' : '',
'{id}' => $this->getOption('id', $this->form->getName() . '_' . $this->name),
'{id}' => $this->getOption('id', strtr($this->form->getName(), ['[' => '_', ']' => '']) . '_' . $this->name),
'{name}' => $this->getOption('name', $this->form->getName() . '[' . $this->name . ']'),
'{label}' => $this->getLabel(),
'{sublabel}' => $this->options->get('sublabel'),
......
......@@ -197,21 +197,21 @@
<div class="row">
<div class="col-lg-12">
<label for="stdClass_multiSubForm" class="form-label">MultiSubForm</label><table class="table form-multiple"><tr><th>Email</th><th>Choice</th><th class="form-multiple-action"/></tr><tr data-index="0"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][0]_email" name="stdClass[multiSubForm][0][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][0]_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][%i%]_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
<input id="stdClass_multiSubForm_0_email" name="stdClass[multiSubForm][0][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass_multiSubForm_0_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass_multiSubForm_%i%_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
class="form-control" required placeholder="user@domain.eu" />
]]></script></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][%i%]_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table><ul class="form-errors"><li>Validator.NotBlank</li></ul></div>
<select id="stdClass_multiSubForm_%i%_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table><ul class="form-errors"><li>Validator.NotBlank</li></ul></div>
</div>
</div>
<div class="form-group ">
<div class="row">
<div class="col-lg-12">
<label for="stdClass[subForm]_subForm" class="form-label">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass[subForm]_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass[subForm]_email" name="stdClass[subForm][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div>
<label for="stdClass_subForm_subForm" class="form-label">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass_subForm_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass_subForm_email" name="stdClass[subForm][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div>
</div></div><div class="form-group "><div class="row">
<label for="stdClass[subForm]_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass[subForm]_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div>
<label for="stdClass_subForm_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass_subForm_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div>
</div></div>
</div>
</div>
......
......@@ -202,23 +202,23 @@
<div class="row">
<div class="col-lg-12">
<label for="stdClass_multiSubForm" class="form-label">MultiSubForm</label><table class="table form-multiple"><tr><th>Email</th><th>Choice</th><th class="form-multiple-action"/></tr><tr data-index="0"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][0]_email" name="stdClass[multiSubForm][0][email]" type="email" value="test1@ok.pl" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][0]_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr data-index="1"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][1]_email" name="stdClass[multiSubForm][1][email]" type="email" value="test2@ok.pl" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][1]_choice" name="stdClass[multiSubForm][1][choice]" class="form-control"><option value="0">zero</option><option value="1" selected="selected">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][%i%]_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
<input id="stdClass_multiSubForm_0_email" name="stdClass[multiSubForm][0][email]" type="email" value="test1@ok.pl" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass_multiSubForm_0_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr data-index="1"><td><div class="form-group required"><div>
<input id="stdClass_multiSubForm_1_email" name="stdClass[multiSubForm][1][email]" type="email" value="test2@ok.pl" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass_multiSubForm_1_choice" name="stdClass[multiSubForm][1][choice]" class="form-control"><option value="0">zero</option><option value="1" selected="selected">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass_multiSubForm_%i%_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
class="form-control" required placeholder="user@domain.eu" />
]]></script></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][%i%]_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table></div>
<select id="stdClass_multiSubForm_%i%_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table></div>
</div>
</div>
<div class="form-group ">
<div class="row">
<div class="col-lg-12">
<label for="stdClass[subForm]_subForm" class="form-label">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass[subForm]_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass[subForm]_email" name="stdClass[subForm][email]" type="email" value="test3@ok.pl" class="form-control" required="" placeholder="user@domain.eu"/></div>
<label for="stdClass_subForm_subForm" class="form-label">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass_subForm_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass_subForm_email" name="stdClass[subForm][email]" type="email" value="test3@ok.pl" class="form-control" required="" placeholder="user@domain.eu"/></div>
</div></div><div class="form-group "><div class="row">
<label for="stdClass[subForm]_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass[subForm]_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0">zero</option><option value="1" selected="selected">jeden</option></select></div>
<label for="stdClass_subForm_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass_subForm_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0">zero</option><option value="1" selected="selected">jeden</option></select></div>
</div></div>
</div>
</div>
......
......@@ -194,21 +194,21 @@
<div class="row">
<div class="col-lg-12">
<label for="stdClass_multiSubForm" class="form-label">MultiSubForm</label><table class="table form-multiple"><tr><th>Email</th><th>Choice</th><th class="form-multiple-action"/></tr><tr data-index="0"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][0]_email" name="stdClass[multiSubForm][0][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][0]_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][%i%]_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
<input id="stdClass_multiSubForm_0_email" name="stdClass[multiSubForm][0][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass_multiSubForm_0_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass_multiSubForm_%i%_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
class="form-control" required placeholder="user@domain.eu" />
]]></script></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][%i%]_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table></div>
<select id="stdClass_multiSubForm_%i%_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table></div>
</div>
</div>
<div class="form-group ">
<div class="row">
<div class="col-lg-12">
<label for="stdClass[subForm]_subForm" class="form-label">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass[subForm]_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass[subForm]_email" name="stdClass[subForm][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div>
<label for="stdClass_subForm_subForm" class="form-label">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass_subForm_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass_subForm_email" name="stdClass[subForm][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div>
</div></div><div class="form-group "><div class="row">
<label for="stdClass[subForm]_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass[subForm]_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div>
<label for="stdClass_subForm_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass_subForm_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div>
</div></div>
</div>
</div>
......
......@@ -84,17 +84,17 @@
]]></script></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table></div>
<div class=" required">
<label for="stdClass_multiSubForm" class="">MultiSubForm</label><table class="table form-multiple"><tr><th>Email</th><th>Choice</th><th class="form-multiple-action"/></tr><tr data-index="0"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][0]_email" name="stdClass[multiSubForm][0][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][0]_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass[multiSubForm][%i%]_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
<input id="stdClass_multiSubForm_0_email" name="stdClass[multiSubForm][0][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div></div></td><td><div class="form-group "><div>
<select id="stdClass_multiSubForm_0_choice" name="stdClass[multiSubForm][0][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr><tr><td colspan="2"/><td class="form-multiple-action"><button type="button" class="form-multiple-add btn btn-success"><span class="fa fa-plus-circle"/></button><script type="text/template" class="form-multiple-add-template"><![CDATA[<tr data-index="%i%"><td><div class="form-group required"><div>
<input id="stdClass_multiSubForm_%i%_email" name="stdClass[multiSubForm][%i%][email]" type="email" value=""
class="form-control" required placeholder="user@domain.eu" />
]]></script></td><td><div class="form-group "><div>
<select id="stdClass[multiSubForm][%i%]_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table></div>
<select id="stdClass_multiSubForm_%i%_choice" name="stdClass[multiSubForm][%i%][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div></div></td><td class="form-multiple-action"><button type="button" class="form-multiple-remove btn btn-danger"><span class="fa fa-trash"/></button></td></tr></table></div>
<div class=" ">
<label for="stdClass[subForm]_subForm" class="">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass[subForm]_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass[subForm]_email" name="stdClass[subForm][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div>
<label for="stdClass_subForm_subForm" class="">SubForm</label><div class="form-group required"><div class="row">
<label for="stdClass_subForm_email" class="form-label col-lg-2">Email</label><div class="col-lg-10"><input id="stdClass_subForm_email" name="stdClass[subForm][email]" type="email" value="" class="form-control" required="" placeholder="user@domain.eu"/></div>
</div></div><div class="form-group "><div class="row">
<label for="stdClass[subForm]_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass[subForm]_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div>
<label for="stdClass_subForm_choice" class="form-label col-lg-2">Choice</label><div class="col-lg-10"><select id="stdClass_subForm_choice" name="stdClass[subForm][choice]" class="form-control"><option value="0" selected="selected">zero</option><option value="1">jeden</option></select></div>
</div></div>
</div>
</fieldset>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment