Skip to content

Commit

Permalink
Reducing the amout of calls to StringTemplate in FormHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jun 16, 2014
1 parent 2118906 commit b77c837
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/View/Helper/FormHelper.php
Expand Up @@ -892,7 +892,11 @@ public function input($fieldName, array $options = []) {
$options += ['id' => $this->_domId($fieldName)];

$originalTemplates = $this->templates();
$this->templates($options['templates']);
$newTemplates = $options['templates'];

if ($newTemplates) {
$this->templates($options['templates']);
}
unset($options['templates']);

$error = null;
Expand Down Expand Up @@ -930,7 +934,10 @@ public function input($fieldName, array $options = []) {
'type' => $options['type'],
]);

$this->templates($originalTemplates);
if ($newTemplates) {
$this->templates($originalTemplates);
}

return $result;
}

Expand Down

0 comments on commit b77c837

Please sign in to comment.