Skip to content

Commit

Permalink
minor #4695 Misc changes (ifdattic)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.3 branch (closes #4695).

Discussion
----------

Misc changes

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

18fa2c6 Misc changes
  • Loading branch information
wouterj committed Dec 29, 2014
2 parents bd65c3c + 18fa2c6 commit 4b442a0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions best_practices/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ for the homepage of our app:
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$posts = $em->getRepository('App:Post')->findLatest();
$posts = $this->getDoctrine()
->getRepository('AppBundle:Post')
->findLatest();
return $this->render('default/index.html.twig', array(
'posts' => $posts
Expand All @@ -136,6 +137,7 @@ For example:

.. code-block:: php
use AppBundle\Entity\Post;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
/**
Expand All @@ -146,7 +148,7 @@ For example:
$deleteForm = $this->createDeleteForm($post);
return $this->render('admin/post/show.html.twig', array(
'post' => $post,
'post' => $post,
'delete_form' => $deleteForm->createView(),
));
}
Expand Down Expand Up @@ -188,8 +190,10 @@ flexible:

.. code-block:: php
use AppBundle\Entity\Post;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Request;
/**
* @Route("/comment/{postSlug}/new", name = "comment_new")
Expand Down

0 comments on commit 4b442a0

Please sign in to comment.