You could use the requirements of the route to verify that a valid
version is supplied. Of course that would be limited to a regex, but
if that's enough, that's where it would go.
Next best option is to create your own route class and customize
things there.

Daniel

On Oct 8, 4:21 am, Shihab KB <shiha...@gmail.com> wrote:
> Dear friends,
>
> Please find one my routing entry.
>
> # Get contents of q&a page by page
> api_qa_get_qa_by_id:
>   url:   /:servicetype/:ver/:lang/:usertoken/:contentid/
> qacontent.:sf_format
>   class:  sfDoctrineRoute
>   param:  { module: qa, action: qabycategory, sf_format: json }
>   options: { model: Questionanswer, type: list, method:
> restGetQaByCategory }
>   requirements:
>     sf_format: (?:xml|json)
>     sf_method: get
>
> I have more than 50 routing entries like this in my project. And that
> may have different modules. In this I would like to validate the
> version using :ver parameter. One way I know is doing the validation
> in the execute<<action>> method of corresponding action class like
>
> execute<<action>>
> {
>   if ($request->getParameter('ver') == ‘1’)
>   {
>      ///lllll
>   }
>
> }
>
> Is there any method to generalize this? Like write the version
> verification code in single place? Hope I explained my doubt well.
> Please advice.
>
> regards
> Shihab

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to