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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:24:28+00:00 2026-06-04T03:24:28+00:00

I am new to Symfony and learning Symfony2 by creating a small project. /

  • 0

I am new to Symfony and learning Symfony2 by creating a small project.

/** UserType buildform function */

$age_choices = array('18'=>'18+','25'=>'25+','30'=>'30+','40'=>'40+','50'=>'50+');

$complextion_choices = array('Moderate'=>'Moderate','Fair'=>'Fair');

$builder
                ->add('first_name', 'text')
                ->add('last_name', 'text')
                ->add('email', 'text')
                ->add('phone', 'text', array('required' => false))
                ->add('age', 'choice', array('choices' => $age_choices) )
                ->add('complextion', 'choice', array('choices' => $complextion_choices) );

/** Creating user form ***/**

$user = new Users();

$form = $this->createForm(new UsersType());

return $this->render('TrytillUserBundle:User:signup.html.twig', array('form' => 
$form->createView()));

Now When I submit this form.. getting it using following way.

$user = new Users();

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

$form->bindRequest($request);


if ($form->isValid()) {

   /// some task here.

}

return $this->render('TrytillUserBundle:User:signup.html.twig', array('form' => $form->createView()));

The problem is that on bindRequest line it saying me that property first_name doesn’t exist in Entity Users.

I have created Users Entity using doctrine and it’s private $firstName in Entity/Users.php

Thanks for any help.

  • 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-04T03:24:30+00:00Added an answer on June 4, 2026 at 3:24 am

    Try ->add('firstName', 'text') instead of ->add('first_name', 'text') in your UserType::buildForm function, same goes for last_name.

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

Sidebar

Related Questions

I'm new to Symfony2, even though I knew symfony 1.4. In my new project,
I've been using Symfony for a long time but I'm new to Symfony2. After
i am trying to setup a new symfony framework project on ubuntu by following
Code: $app->register(new Silex\Provider\TranslationServiceProvider(), array( 'locale' => 'sr_Latn', 'translation.class_path' => __DIR__ . '/../vendor/symfony/src', 'translator.messages' =>
the symfony form is, 'nation' =>new sfWidgetFormChoice(array('choices' => NationPeer::getAllNation())), 'township' =>new sfWidgetFormChoice(array('choices' => TownshipPeer::getAllTownship())),
I'm thining about using symfony 2.0 for my new project. It's only preview a
I use symfony's ProjectConfiguration.class.php for configuring doctrine's connection: public function configureDoctrineConnectionCertby(Doctrine_Connection $conn) { $conn->setListener(new
I have just set up a completely new Symfony 1.4 project and designed the
I'm completely new with Symfony and Doctrine. I have generated a project with a
I'm working on a new big PHP / Symfony 2 project and decided to

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.