X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FTagController.php;h=8645fb442621b933a10df0d127c5919b4cecd3d6;hb=5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3;hp=1a1f8c3d3b15233fda2ae92874a7a7f5c22d9b41;hpb=ba2157b270095757eb5af8062df72ce16c497637;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 1a1f8c3d..8645fb44 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -13,6 +13,7 @@ class TagController extends Controller { /** * @param Request $request + * @param Entry $entry * * @Route("/new-tag/{entry}", requirements={"entry" = "\d+"}, name="new_tag") * @@ -38,13 +39,13 @@ class TagController extends Controller 'flashes.tag.notice.tag_added' ); - return $this->redirect($this->generateUrl('view', array('id' => $entry->getId()))); + return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); } - return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', array( + return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', [ 'form' => $form->createView(), 'entry' => $entry, - )); + ]); } /** @@ -64,7 +65,9 @@ class TagController extends Controller } $em->flush(); - return $this->redirect($request->headers->get('referer')); + $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer')); + + return $this->redirect($redirectUrl); } /** @@ -78,13 +81,13 @@ class TagController extends Controller { $tags = $this->getDoctrine() ->getRepository('WallabagCoreBundle:Tag') - ->findTags($this->getUser()->getId()); + ->findAllTags($this->getUser()->getId()); return $this->render( 'WallabagCoreBundle:Tag:tags.html.twig', - array( + [ 'tags' => $tags, - ) + ] ); } }