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

  • Home
  • SEARCH
  • 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 8718875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:39:23+00:00 2026-06-13T06:39:23+00:00

Form/Type class DemoType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add(‘name’,

  • 0

Form/Type

class DemoType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name', 'text');
    }

    // ...
}

Controller

$user = new User();
$form = $this->createForm(new DemoType(), $user);

if ($request->getMethod() == 'POST') {
    $form->bindRequest($request);
    if ($form->isValid()) {
        $em = $this->get('doctrine')->getEntityManager();
        $em->persist($user);
        $em->flush();
        return // ...
    }
}

View

<form action="{{ path }}" method="post" {{ form_enctype(form) }}>
    <div>
        {{ form_widget(form.name) }}
    </div>
    {{ form_rest(form) }}
</form>

I would like to register plurality at once.
(Finally I would like to add an input field by the view side.(plus button etc. JavaScript))

What should I do to register two or more users at once?

  • 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-13T06:39:24+00:00Added an answer on June 13, 2026 at 6:39 am

    You should be using the collection form type. See here for a detailed explanation. The plus button and dynamic creation of new subform has to be handled by javascript but it’s all explained in the documentation.

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

Sidebar

Related Questions

//--form timesheettype---it is not entity class class TimeSheetType extends AbstractType { public function buildForm(FormBuilder
I have a form without class class ProfilesSearchType extends AbstractType { public function buildForm(FormBuilder
I have a form using this class type: class DespesasContainerType extends AbstractType { public
I have this code, but it doesn't work: $builder->add('name','text',array( 'label' => 'Due Date', ));
My App ist running, but when I use a custom Form-Field-Type (shtumi_daterange) like: public
I have a form type in symfony2 : namespace Acme\SomethingBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilder;
I get the following error: Fatal error: Declaration of Bean\OauthServerBundle\Form\Type\AuthorizeFormType::buildForm() must be compatible with
On my Drupal website I've got something like this: <div class=form-item form-type-textfield item-1> <div
I have a public property set in my form of type ListE<T> where: public
I'm actually developping a custom form field type which extends a file form field

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.