3
3
namespace Symfony \Bundle \FrameworkBundle \Templating \Helper ;
4
4
5
5
use Symfony \Component \Templating \Helper \Helper ;
6
- use Symfony \Component \Templating \Engine ;
7
6
use Symfony \Component \Form \FieldInterface ;
8
7
use Symfony \Component \Form \FieldGroupInterface ;
8
+ use Symfony \Bundle \FrameworkBundle \Templating \DelegatingEngine ;
9
9
10
10
/*
11
11
* This file is part of the Symfony framework.
@@ -28,7 +28,7 @@ class FormHelper extends Helper
28
28
29
29
protected $ engine ;
30
30
31
- public function __construct (Engine $ engine )
31
+ public function __construct (DelegatingEngine $ engine )
32
32
{
33
33
$ this ->engine = $ engine ;
34
34
}
@@ -109,7 +109,7 @@ public function render(/*FieldInterface */$field, array $attributes = array(), a
109
109
public function label (/*FieldInterface */ $ field , $ label = false , array $ parameters = array (), $ template = null )
110
110
{
111
111
if (null === $ template ) {
112
- $ template = 'FrameworkBundle:Form:label.php ' ;
112
+ $ template = 'FrameworkBundle:Form:label.php.html ' ;
113
113
}
114
114
115
115
return $ this ->engine ->render ($ template , array (
@@ -122,7 +122,7 @@ public function label(/*FieldInterface */$field, $label = false, array $paramete
122
122
public function errors (/*FieldInterface */ $ field , array $ parameters = array (), $ template = null )
123
123
{
124
124
if (null === $ template ) {
125
- $ template = 'FrameworkBundle:Form:errors.php ' ;
125
+ $ template = 'FrameworkBundle:Form:errors.php.html ' ;
126
126
}
127
127
128
128
return $ this ->engine ->render ($ template , array (
@@ -134,7 +134,7 @@ public function errors(/*FieldInterface */$field, array $parameters = array(), $
134
134
public function hidden (/*FieldGroupInterface */ $ group , array $ parameters = array (), $ template = null )
135
135
{
136
136
if (null === $ template ) {
137
- $ template = 'FrameworkBundle:Form:hidden.php ' ;
137
+ $ template = 'FrameworkBundle:Form:hidden.php.html ' ;
138
138
}
139
139
140
140
return $ this ->engine ->render ($ template , array (
@@ -161,15 +161,15 @@ protected function lookupTemplate(/*FieldInterface */$field)
161
161
162
162
$ underscoredName = strtolower (preg_replace (array ('/([A-Z]+)([A-Z][a-z])/ ' , '/([a-z\d])([A-Z])/ ' ), array ('\\1_ \\2 ' , '\\1_ \\2 ' ), strtr ($ className , '_ ' , '. ' )));
163
163
164
- if ($ this ->engine ->exists ($ guess = 'FrameworkBundle:Form: ' .$ underscoredName .'.php ' )) {
164
+ if ($ this ->engine ->exists ($ guess = 'FrameworkBundle:Form: ' .$ underscoredName .'.php.html ' )) {
165
165
$ template = $ guess ;
166
166
}
167
167
168
168
$ currentFqClassName = get_parent_class ($ currentFqClassName );
169
169
} while (null === $ template && false !== $ currentFqClassName );
170
170
171
171
if (null === $ template && $ field instanceof FieldGroupInterface) {
172
- $ template = 'FrameworkBundle:Form:field_group.php ' ;
172
+ $ template = 'FrameworkBundle:Form:field_group.php.html ' ;
173
173
}
174
174
175
175
self ::$ cache [$ fqClassName ] = $ template ;
0 commit comments