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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:32:52+00:00 2026-06-15T00:32:52+00:00

The user sumbits a form that was build using the symfony 2 framework with

  • 0

The user sumbits a form that was build using the symfony 2 framework with abstract type:

<?php
$form = $this->createForm(new MyAbstractType(), new MyEntity());

I receive this post request in an action:

public function receiveFormRequestAction(Request $request){
    //How do I get the abstract type from the request?
}

I need to be able to create the AbstractType used on the form using only information in the request.

  1. Is it possible?
  2. How do you do it?

Thanks.

Edit:

Sorry if i wasn’t clear enough. in the method “recieveFormRequestAction” i don’t know what abstract type i am going to get, so i cant bind the form directly to MyAbstractType.

This action can, in theory, recieve any AbastractType and bind it.

  • 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-15T00:32:53+00:00Added an answer on June 15, 2026 at 12:32 am

    I ended up doing this:

    1. The method getName() on my forms returned exactly the same name as the Form class name

      Class MyAbstractType extends AbstractType
        [...]
        public function getName(){
          return "MyAbstractType";
      }
      
    2. Now i can get the type using the hash on the parameter keys

      public function myAction(Request $request){
      $parameterKeys = $request->request->keys();
      $formName = $parameterKeys[0];
      

    Ugly as hell, but i needed a quick solution. Until there is a cleaner one, i’m accepting this.

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

Sidebar

Related Questions

I am using FirePHP with Zend Framework. When the user submits a form, I
I have this code that I run when a user submits a form (this
I have the code below on form so that the user submits the form
I have a form that the user submits and returns a result, but it
After a user submits a form, how do you detect that the form has
I have situation like this: user submits form with action='/pay' in '/pay' I have
I have a form that has three submit buttons as follows: <input type=submit name=COMMAND
Basically, I have a page that contains a form. When a user submits that
Okay so here's the scenario: User is presented with form that contains file inputs.
<form action=??? method=POST> <input type=text name=content> </form> Suppose I'm using Backbone.js's routes feature, and

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.