@@ -70,6 +70,7 @@ below renders the ``index.html.php`` template::
70
70
// ...
71
71
public function index($name)
72
72
{
73
+ // template is stored in src/Resources/views/hello/index.html.php
73
74
return $this->render('hello/index.html.php', array(
74
75
'name' => $name
75
76
));
@@ -118,7 +119,7 @@ the ``extend()`` call:
118
119
119
120
.. code-block :: html+php
120
121
121
- <!-- templates/Hello /index.html.php -->
122
+ <!-- src/Resources/views/hello /index.html.php -->
122
123
<?php $view->extend('layout.html.php') ?>
123
124
124
125
Hello <?php echo $name ?>!
@@ -127,7 +128,7 @@ Now, have a look at the ``layout.html.php`` file:
127
128
128
129
.. code-block :: html+php
129
130
130
- <!-- templates /layout.html.php -->
131
+ <!-- src/Resources/views /layout.html.php -->
131
132
<?php $view->extend('base.html.php') ?>
132
133
133
134
<h1>Hello Application</h1>
@@ -140,7 +141,7 @@ another one:
140
141
141
142
.. code-block :: html+php
142
143
143
- <!-- templates /base.html.php -->
144
+ <!-- src/Resources/views /base.html.php -->
144
145
<!DOCTYPE html>
145
146
<html>
146
147
<head>
@@ -173,7 +174,7 @@ decorating the template. In the ``index.html.php`` template, define a
173
174
174
175
.. code-block :: html+php
175
176
176
- <!-- templates /hello/index.html.php -->
177
+ <!-- src/Resources/views /hello/index.html.php -->
177
178
<?php $view->extend('layout.html.php') ?>
178
179
179
180
<?php $view['slots']->set('title', 'Hello World Application') ?>
@@ -184,7 +185,7 @@ The base layout already has the code to output the title in the header:
184
185
185
186
.. code-block :: html+php
186
187
187
- <!-- templates /base.html.php -->
188
+ <!-- src/Resources/views /base.html.php -->
188
189
<head>
189
190
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
190
191
<title><?php $view['slots']->output('title', 'Hello Application') ?></title>
@@ -215,14 +216,14 @@ Create a ``hello.html.php`` template:
215
216
216
217
.. code-block :: html+php
217
218
218
- <!-- templates /hello/hello.html.php -->
219
+ <!-- src/Resources/views /hello/hello.html.php -->
219
220
Hello <?php echo $name ?>!
220
221
221
222
And change the ``index.html.php `` template to include it:
222
223
223
224
.. code-block :: html+php
224
225
225
- <!-- templates /hello/index.html.php -->
226
+ <!-- src/Resources/views /hello/index.html.php -->
226
227
<?php $view->extend('layout.html.php') ?>
227
228
228
229
<?php echo $view->render('hello/hello.html.php', array('name' => $name)) ?>
@@ -245,7 +246,7 @@ If you create a ``fancy`` action, and want to include it into the
245
246
246
247
.. code-block :: html+php
247
248
248
- <!-- templates/Hello /index.html.php -->
249
+ <!-- src/Resources/views/hello /index.html.php -->
249
250
<?php echo $view['actions']->render(
250
251
new \S ymfony\C omponent\H ttpKernel\C ontroller\C ontrollerReference(
251
252
'App\C ontroller\H elloController::fancy',
0 commit comments