php - Migrating routes from old format to new one, where is the docs for this? Missing? -


as perhaps may notice previous post i'm working on sf2.0.x app new sf2.7. right i'm having lot of notice , don't affect app functionality , want prevent this. have read routing chapter @ sf book, the routing component , @ route , @method annotations can't find helpful fix issue. need people here. right now, routes, looks 1 below (in xml format):

<route id="pdonebundle_repproject_process" path="/project/{page}/{action}">     <default key="_controller">pdonebundle:projectdetail:process</default>     <requirement key="page">\w+</requirement>     <requirement key="action">add|update|delete</requirement>     <requirement key="_format">html</requirement>     <requirement key="_method">post|get</requirement> </route> 

and message below notice getting:

deprecated - "_method" requirement deprecated since version 2.2 , removed in 3.0. use setmethods() method instead or "methods" option in route definition.

what right way define routes now?

you should read this:

https://github.com/symfony/symfony/blob/master/upgrade-3.0.md

and part searched:

routing      route settings have been renamed:     pattern setting route has been deprecated in favor of path     _scheme , _method requirements have been moved schemes , methods settings  before:  article_edit:    pattern: /article/{id}    requirements: { '_method': 'post|put', '_scheme': 'https', 'id': '\d+' }  <route id="article_edit" pattern="/article/{id}">    <requirement key="_method">post|put</requirement>    <requirement key="_scheme">https</requirement>    <requirement key="id">\d+</requirement> </route>  $route = new route(); $route->setpattern('/article/{id}'); $route->setrequirement('_method', 'post|put'); $route->setrequirement('_scheme', 'https');  after:  article_edit:    path: /article/{id}    methods: [post, put]    schemes: https    requirements: { 'id': '\d+' }  <route id="article_edit" path="/article/{id}" methods="post put" schemes="https">    <requirement key="id">\d+</requirement> </route>  $route = new route(); $route->setpath('/article/{id}'); $route->setmethods(array('post', 'put')); $route->setschemes('https'); 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -