Skip to content

Commit 4b442a0

Browse files
committed
minor #4695 Misc changes (ifdattic)
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
2 parents bd65c3c + 18fa2c6 commit 4b442a0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

best_practices/controllers.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ for the homepage of our app:
110110
*/
111111
public function indexAction()
112112
{
113-
$em = $this->getDoctrine()->getManager();
114-
$posts = $em->getRepository('App:Post')->findLatest();
113+
$posts = $this->getDoctrine()
114+
->getRepository('AppBundle:Post')
115+
->findLatest();
115116
116117
return $this->render('default/index.html.twig', array(
117118
'posts' => $posts
@@ -136,6 +137,7 @@ For example:
136137

137138
.. code-block:: php
138139
140+
use AppBundle\Entity\Post;
139141
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
140142
141143
/**
@@ -146,7 +148,7 @@ For example:
146148
$deleteForm = $this->createDeleteForm($post);
147149
148150
return $this->render('admin/post/show.html.twig', array(
149-
'post' => $post,
151+
'post' => $post,
150152
'delete_form' => $deleteForm->createView(),
151153
));
152154
}
@@ -188,8 +190,10 @@ flexible:
188190

189191
.. code-block:: php
190192
193+
use AppBundle\Entity\Post;
191194
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
192195
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
196+
use Symfony\Component\HttpFoundation\Request;
193197
194198
/**
195199
* @Route("/comment/{postSlug}/new", name = "comment_new")

0 commit comments

Comments
 (0)