@@ -105,6 +105,7 @@ public function render($controller, array $options = array())
105
105
'alt ' => array (),
106
106
'standalone ' => false ,
107
107
'comment ' => '' ,
108
+ 'default ' => null ,
108
109
), $ options );
109
110
110
111
if (!is_array ($ options ['alt ' ])) {
@@ -130,8 +131,16 @@ public function render($controller, array $options = array())
130
131
$ uri = $ this ->generateInternalUri ($ controller , $ options ['attributes ' ], $ options ['query ' ], false );
131
132
$ defaultContent = null ;
132
133
133
- if ($ template = $ this ->container ->getParameter ('templating.hinclude.default_template ' )) {
134
- $ defaultContent = $ this ->container ->get ('templating ' )->render ($ template );
134
+ $ templating = $ this ->container ->get ('templating ' );
135
+
136
+ if ($ options ['default ' ]) {
137
+ if ($ templating ->exists ($ options ['default ' ])) {
138
+ $ defaultContent = $ templating ->render ($ options ['default ' ]);
139
+ } else {
140
+ $ defaultContent = $ options ['default ' ];
141
+ }
142
+ } elseif ($ template = $ this ->container ->getParameter ('templating.hinclude.default_template ' )) {
143
+ $ defaultContent = $ templating ->render ($ template );
135
144
}
136
145
137
146
return $ this ->renderHIncludeTag ($ uri , $ defaultContent );
@@ -226,7 +235,7 @@ public function generateInternalUri($controller, array $attributes = array(), ar
226
235
/**
227
236
* Renders an HInclude tag.
228
237
*
229
- * @param string $uri A URI
238
+ * @param string $uri A URI
230
239
* @param string $defaultContent Default content
231
240
*/
232
241
public function renderHIncludeTag ($ uri , $ defaultContent = null )
0 commit comments