Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8370777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:59:48+00:00 2026-06-09T13:59:48+00:00

In Symfony2 it is possible to define 2 different @routes to get one same

  • 0

In Symfony2 it is possible to define 2 different @routes to get one same Controller and Action?

The thing is: how do you check in that unique action what path or route does the user come from?

Example: Imagine we have an action called "createUserAction" that can be reached both from @routes /common_register and /premium_register.

Inside the action I want to difference between the two kinds of users, to use different forms and create the users according to the route they have entered through (or in general, have a different behavour depending o it).

How do I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:59:49+00:00Added an answer on June 9, 2026 at 1:59 pm

    In your action, just add additional special route parameter $_route to the method

    public function createUserAction ($_route)
    {
        ... //$_route will return the name of your route
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is that possible with symfony2 to define multiple url patterns for a single Controller
Is it possible to authenticate via username or IP in Symfony2? I know that
I'm developing a Symfony 1.4 plugin and I noticed that plugin routes get matched
I'm using propel master-dev with symfony 2.1. Is possible to write something like that
In Symfony2 (2.0.3) I have a BetaBundle that is set as the parent of
How can I use the Symfony2 ClassLoader to autoload classes that dont follow PEAR
I have a console app, (written as a Symfony2 command) that is reading input
You know that in Symfony2 a new entity can be defined as in the
Is it easy/possible to tell symfony2 to respect the Accept-Encoding header sent by web
Is it possible to generate a single entity from database using the Symfony2 console

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.