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 7008787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:46:48+00:00 2026-05-27T21:46:48+00:00

Is it possible to forward a request, passing along all GET/POST params? I think

  • 0

Is it possible to forward a request, passing along all GET/POST params?

I think if I just do

$this->forward('dest')

I will go to dest without any GET/POST params?

UPDATE

My objective is actually to have a controller action like addSomething that takes checks that the user has the sufficient “items” to add something. Then forward the request to the approperiate controller to continue the actual adding of adding{Type}Something

Or would getting a “checking” service in all controllers that does the checking be more appropriate? Anyways, I think its informative to know how to forward to a controller action with all params

  • 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-05-27T21:46:49+00:00Added an answer on May 27, 2026 at 9:46 pm

    I don’t see any reason here to forward the request back through the kernel. You can go the route of encapsulating this logic in a checker service, as you’ve suggested, or you may be able to create a kernel.request listener that runs after the router listener and applies the _controller attribute only if your conditions are met.

    For example, this routing.yml:

    some_route:
        pattern:  /xyz
        defaults: { _controller_candidate: "FooBundle:Bar:baz" }
    

    And this listener:

    class MyListener
    {
        public function onKernelRequest($event)
        {
            $request = $event->getRequest();
            if (!$controller = $request->attributes->get('_controller_candidiate')) {
                return;
            }
    
            if (/* your logic... */) {
                $request->attributes->set('_controller', $controller');
            }
        }
    }
    

    Configured to run after the core router listener:

    services:
        my_listener:
            class: MyListener
            tags:
                -
                    name:     kernel.event_listener
                    event:    kernel.request
                    priority: -10
    

    The priority of the core router listener is 0 in Symfony 2.0 and 32 in Symfony 2.1. In either case, a priority of -10 should work.

    I’m curious to see if this works 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a possible htaccess directive that can transparently forward request from index.php to
I'll try to make this as straight forward as possible. Currently our team has
Is this possible? I am looking forward to a tutorial which explains the steps
Is it possible to forward declare a class that uses default arguments without specifying
Is it possible to forward the request from a servlet running to another servlet
I just have a quick question to see if this is possible with the
Is it possible to forward declare an standard container in a header file? For
Is it possible to forward-declare a nested class, then use it as the type
Possible Duplicate: What features are people looking forward to in .Net 4.0 - 4.1
Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be

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.