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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:47:19+00:00 2026-06-13T11:47:19+00:00

We are developing two separate sites on Symfony2 and encountered a strange problem on

  • 0

We are developing two separate sites on Symfony2 and encountered a strange problem on both of them when processing submitted forms.

Both sites have an action that is used for both displaying the form and handling submission. As it handles both GET and POST requests, $this->getRequest()->getMethod() is checked. If it is GET, we display the form. If it is POST, we persist it into an entity.

However, getMethod() seems to always return GET even when posting the data. I know the request method should be POST because the browser’s network inspector says it sent the form as a POST request and var_dump($_POST); outputs the contents of the form we just submitted.

The sites are running on separate servers, both CentOS 6.3. I have a third similar server running a third site which handles the submissions fine. What could be causing this?

  • 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-13T11:47:20+00:00Added an answer on June 13, 2026 at 11:47 am

    I’ve had such a problem several times and tried different approaches to it. Here’s my last one:

    public function formAction(Request $request)
    {
    }
    
    {% render 'Bundle:Controller:form' with {'request': app.request} %}
    

    Note that you need to get the request as a parameter in this case — instead of fetching it from the container. If you’re using Symfony idiomatically, then you’re doing that already.

    If you’ll ever find a better way of solving this problem, I’m eager to know it. 🙂

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

Sidebar

Related Questions

I am developing two java programs that run in separate VM's that have a
I have a server application and two Swing-based client applications. We're developing them in
I'm new to magento. Currently i'm developing two ecommerce sites using multi-store option in
I have been developing in Android for approximately two months now. Yesterday, my eclipse
I'm developing a project with two different sites, divided by language. Maybe I was
I am currently switching from developing two separate Xcode Projects into using Xcode workspace.
I have two USB keyboards plugged into the same machine. I am developing a
We are developing a very large web application in .Net 3.5. Two separate vendors
I am currently developing 2 sites that have identical functionality for a single client,
I am developing a Java ME program. The different forms are located in separate

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.