8000 Update most important book articles to follow the best practices by wouterj · Pull Request #4427 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update most important book articles to follow the best practices #4427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Nov 7, 2014
Merged
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
0