Skip to content

Commit 550cd58

Browse files
committed
Fixed PHP templates location
1 parent d0ede99 commit 550cd58

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

templating/PHP.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ below renders the ``index.html.php`` template::
7070
// ...
7171
public function index($name)
7272
{
73+
// template is stored in src/Resources/views/hello/index.html.php
7374
return $this->render('hello/index.html.php', array(
7475
'name' => $name
7576
));
@@ -118,7 +119,7 @@ the ``extend()`` call:
118119

119120
.. code-block:: html+php
120121

121-
<!-- templates/Hello/index.html.php -->
122+
<!-- src/Resources/views/hello/index.html.php -->
122123
<?php $view->extend('layout.html.php') ?>
123124

124125
Hello <?php echo $name ?>!
@@ -127,7 +128,7 @@ Now, have a look at the ``layout.html.php`` file:
127128

128129
.. code-block:: html+php
129130

130-
<!-- templates/layout.html.php -->
131+
<!-- src/Resources/views/layout.html.php -->
131132
<?php $view->extend('base.html.php') ?>
132133

133134
<h1>Hello Application</h1>
@@ -140,7 +141,7 @@ another one:
140141

141142
.. code-block:: html+php
142143

143-
<!-- templates/base.html.php -->
144+
<!-- src/Resources/views/base.html.php -->
144145
<!DOCTYPE html>
145146
<html>
146147
<head>
@@ -173,7 +174,7 @@ decorating the template. In the ``index.html.php`` template, define a
173174

174175
.. code-block:: html+php
175176

176-
<!-- templates/hello/index.html.php -->
177+
<!-- src/Resources/views/hello/index.html.php -->
177178
<?php $view->extend('layout.html.php') ?>
178179

179180
<?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:
184185

185186
.. code-block:: html+php
186187

187-
<!-- templates/base.html.php -->
188+
<!-- src/Resources/views/base.html.php -->
188189
<head>
189190
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
190191
<title><?php $view['slots']->output('title', 'Hello Application') ?></title>
@@ -215,14 +216,14 @@ Create a ``hello.html.php`` template:
215216

216217
.. code-block:: html+php
217218

218-
<!-- templates/hello/hello.html.php -->
219+
<!-- src/Resources/views/hello/hello.html.php -->
219220
Hello <?php echo $name ?>!
220221

221222
And change the ``index.html.php`` template to include it:
222223

223224
.. code-block:: html+php
224225

225-
<!-- templates/hello/index.html.php -->
226+
<!-- src/Resources/views/hello/index.html.php -->
226227
<?php $view->extend('layout.html.php') ?>
227228

228229
<?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
245246

246247
.. code-block:: html+php
247248

248-
<!-- templates/Hello/index.html.php -->
249+
<!-- src/Resources/views/hello/index.html.php -->
249250
<?php echo $view['actions']->render(
250251
new \Symfony\Component\HttpKernel\Controller\ControllerReference(
251252
'App\Controller\HelloController::fancy',

0 commit comments

Comments
 (0)