Skip to content
Prev Previous commit
Next Next commit
Moved templates to app
  • Loading branch information
wouterj committed Nov 5, 2014
commit 18e3a317472e5418649277fa61645a74778a0fcc
18 changes: 6 additions & 12 deletions book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,7 @@ them for you. Here's the same sample application, now built in Symfony::
->createQuery('SELECT p FROM AcmeBlogBundle:Post p')
->execute();

return $this->render(
'AcmeBlogBundle:Blog:list.html.php',
array('posts' => $posts)
);
return $this->render('Blog/list.html.php', array('posts' => $posts));
}

public function showAction($id)
Expand All @@ -579,10 +576,7 @@ them for you. Here's the same sample application, now built in Symfony::
throw $this->createNotFoundException();
}

return $this->render(
'AcmeBlogBundle:Blog:show.html.php',
array('post' => $post)
);
return $this->render('Blog/show.html.php', array('post' => $post));
}
}

Expand All @@ -593,8 +587,8 @@ now quite a bit simpler:

.. code-block:: html+php

<!-- src/Acme/BlogBundle/Resources/views/Blog/list.html.php -->
<?php $view->extend('::layout.html.php') ?>
<!-- app/Resources/views/Blog/list.html.php -->
<?php $view->extend('layout.html.php') ?>

<?php $view['slots']->set('title', 'List of Posts') ?>

Expand Down Expand Up @@ -716,8 +710,8 @@ for example, the list template written in Twig:

.. code-block:: html+jinja

{# src/Acme/BlogBundle/Resources/views/Blog/list.html.twig #}
{% extends "::layout.html.twig" %}
{# app/Resources/views/Blog/list.html.twig #}
{% extends "layout.html.twig" %}

{% block title %}List of Posts{% endblock %}

Expand Down