Skip to content

Commit b356c6c

Browse files
committed
[Form] [TwigBridge] Added option to disable usage of default themes when rendering a form
1 parent 8406018 commit b356c6c

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Templating/Helper/FormHelper.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ public function getName()
4949
*
5050
* The theme format is "<Bundle>:<Controller>".
5151
*
52-
* @param FormView $view A FormView instance
53-
* @param string|array $themes A theme or an array of theme
52+
* @param FormView $view A FormView instance
53+
* @param string|array $themes A theme or an array of theme
54+
* @param bool $useDefaultThemes If true, will use default themes defined in the renderer
5455
*/
55-
public function setTheme(FormView $view, $themes)
56+
public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
5657
{
57-
$this->renderer->setTheme($view, $themes);
58+
$this->renderer->setTheme($view, $themes, $useDefaultThemes);
5859
}
5960

6061
/**

Tests/Templating/Helper/FormHelperDivLayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ protected function renderEnd(FormView $view, array $vars = array())
121121
return (string) $this->engine->get('form')->end($view, $vars);
122122
}
123123

124-
protected function setTheme(FormView $view, array $themes)
124+
protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
125125
{
126-
$this->engine->get('form')->setTheme($view, $themes);
126+
$this->engine->get('form')->setTheme($view, $themes, $useDefaultThemes);
127127
}
128128

129129
public static function themeBlockInheritanceProvider()

Tests/Templating/Helper/FormHelperTableLayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ protected function renderEnd(FormView $view, array $vars = array())
122122
return (string) $this->engine->get('form')->end($view, $vars);
123123
}
124124

125-
protected function setTheme(FormView $view, array $themes)
125+
protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
126126
{
127-
$this->engine->get('form')->setTheme($view, $themes);
127+
$this->engine->get('form')->setTheme($view, $themes, $useDefaultThemes);
128128
}
129129
}

0 commit comments

Comments
 (0)