From 4e1496d0efd78c549024ba8f3b2aa4326c22e822 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 7 Sep 2018 09:59:55 +0200 Subject: [PATCH] stop using the deprecated @Method annotation --- quick_tour/the_controller.rst | 2 -- routing/custom_route_loader.rst | 2 +- routing/requirements.rst | 7 ++----- service_container/autowiring.rst | 11 +++-------- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/quick_tour/the_controller.rst b/quick_tour/the_controller.rst index 81456954141..9fb8f3391a7 100644 --- a/quick_tour/the_controller.rst +++ b/quick_tour/the_controller.rst @@ -115,7 +115,6 @@ as its default value:: // src/AppBundle/Controller/DefaultController.php use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; // ... @@ -154,7 +153,6 @@ option of the ``@Route()`` annotation:: // src/AppBundle/Controller/DefaultController.php use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; // ... diff --git a/routing/custom_route_loader.rst b/routing/custom_route_loader.rst index 1ab7a49d755..01d061c7e7a 100644 --- a/routing/custom_route_loader.rst +++ b/routing/custom_route_loader.rst @@ -29,7 +29,7 @@ Loading Routes The routes in a Symfony application are loaded by the :class:`Symfony\\Bundle\\FrameworkBundle\\Routing\\DelegatingLoader`. This loader uses several other loaders (delegates) to load resources of -different types, for instance YAML files or ``@Route`` and ``@Method`` annotations +different types, for instance YAML files or ``@Route`` annotations in controller files. The specialized loaders implement :class:`Symfony\\Component\\Config\\Loader\\LoaderInterface` and therefore have two important methods: diff --git a/routing/requirements.rst b/routing/requirements.rst index 6e7e2cbbe4f..f0275ff0bc6 100644 --- a/routing/requirements.rst +++ b/routing/requirements.rst @@ -187,14 +187,12 @@ accomplished with the following route configuration: // src/AppBundle/Controller/BlogApiController.php namespace AppBundle\Controller; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; // ... class BlogApiController extends Controller { /** - * @Route("/api/posts/{id}") - * @Method({"GET","HEAD"}) + * @Route("/api/posts/{id}", methods={"GET","HEAD"}) */ public function showAction($id) { @@ -202,8 +200,7 @@ accomplished with the following route configuration: } /** - * @Route("/api/posts/{id}") - * @Method("PUT") + * @Route("/api/posts/{id}", methods={"PUT"}) */ public function editAction($id) { diff --git a/service_container/autowiring.rst b/service_container/autowiring.rst index 169bce6f1f6..36f40404746 100644 --- a/service_container/autowiring.rst +++ b/service_container/autowiring.rst @@ -106,7 +106,6 @@ Here is a typical controller using the ``twitter_client`` service:: namespace Acme\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -115,8 +114,7 @@ Here is a typical controller using the ``twitter_client`` service:: class DefaultController extends Controller { /** - * @Route("/tweet") - * @Method("POST") + * @Route("/tweet", methods={"POST"}) */ public function tweetAction(Request $request) { @@ -259,7 +257,6 @@ transformer:: namespace Acme\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -268,8 +265,7 @@ transformer:: class DefaultController extends Controller { /** - * @Route("/tweet") - * @Method("POST") + * @Route("/tweet", methods={"POST"}) */ public function tweetAction(Request $request) { @@ -277,8 +273,7 @@ transformer:: } /** - * @Route("/tweet-uppercase") - * @Method("POST") + * @Route("/tweet-uppercase", methods={"POST"}) */ public function tweetUppercaseAction(Request $request) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy