Add help texts for checkboxes in horizontal bootstrap 4 forms
This commit is contained in:
parent
d0a97b40ae
commit
1483c87aab
@ -81,6 +81,7 @@ col-sm-10
|
||||
<div class="{{ block('form_label_class') }}"></div>{#--#}
|
||||
<div class="{{ block('form_group_class') }}">
|
||||
{{- form_widget(form) -}}
|
||||
{{- form_help(form) -}}
|
||||
{{- form_errors(form) -}}
|
||||
</div>{#--#}
|
||||
</div>
|
||||
|
@ -214,4 +214,24 @@ abstract class AbstractBootstrap4HorizontalLayoutTest extends AbstractBootstrap4
|
||||
|
||||
$this->assertMatchesXpath($html, '/div[@class="form-group row"]/div[@class="col-sm-2" or @class="col-sm-10"]', 2);
|
||||
}
|
||||
|
||||
public function testCheckboxRowWithHelp()
|
||||
{
|
||||
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType');
|
||||
$view = $form->createView();
|
||||
$html = $this->renderRow($view, array('label' => 'foo', 'help' => 'really helpful text'));
|
||||
|
||||
$this->assertMatchesXpath($html,
|
||||
'/div
|
||||
[@class="form-group row"]
|
||||
[
|
||||
./div[@class="col-sm-2" or @class="col-sm-10"]
|
||||
/following-sibling::div[@class="col-sm-2" or @class="col-sm-10"]
|
||||
[
|
||||
./small[text() = "[trans]really helpful text[/trans]"]
|
||||
]
|
||||
]
|
||||
'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user