[Form] Fixed signature of FormThemeInterface::render()

This commit is contained in:
Bernhard Schussek 2011-03-27 13:42:20 +02:00
parent b21929423e
commit 67d85c6bc7
4 changed files with 10 additions and 4 deletions

View File

@ -48,8 +48,10 @@ class PhpEngineTheme implements FormThemeInterface
$this->templateDir = $templateDir; $this->templateDir = $templateDir;
} }
public function render(array $blocks, $section, array $parameters) public function render($blocks, $section, array $parameters)
{ {
$blocks = (array)$blocks;
foreach ($blocks as &$block) { foreach ($blocks as &$block) {
$block = $block.'_'.$section; $block = $block.'_'.$section;

View File

@ -13,5 +13,5 @@ namespace Symfony\Component\Form\Renderer\Theme;
interface FormThemeInterface interface FormThemeInterface
{ {
function render(array $blocks, $section, array $parameters); function render($blocks, $section, array $parameters);
} }

View File

@ -33,8 +33,10 @@ class PhpTheme implements FormThemeInterface
$this->charset = $charset; $this->charset = $charset;
} }
public function render(array $blocks, $section, array $parameters) public function render($blocks, $section, array $parameters)
{ {
$blocks = (array)$blocks;
foreach ($blocks as $block) { foreach ($blocks as $block) {
$method = $block.'_'.$section; $method = $block.'_'.$section;

View File

@ -73,10 +73,12 @@ class TwigTheme implements FormThemeInterface
return array_unique($names); return array_unique($names);
} }
public function render(array $blocks, $section, array $parameters) public function render($blocks, $section, array $parameters)
{ {
$this->initialize(); $this->initialize();
$blocks = (array)$blocks;
foreach ($blocks as $block) { foreach ($blocks as $block) {
$blockName = $block.'__'.$section; $blockName = $block.'__'.$section;