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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:32:36+00:00 2026-05-27T10:32:36+00:00

I am new to symfony, after going through several online tutorials and blogs, i

  • 0

I am new to symfony, after going through several online tutorials and blogs, i am trying to create a simple project. I created some modules with command console. and now i have created a form using simple html and now i need to store the form values in database. I am trying to do it in a simple way, like i am getting an array of sfWebRequest $request and then i did something like:-

$name = $request->getPostParameters()['name'];
$email = $request->getPostParameters()['email'];
$password = $request->getPostParameters()['password'];

however I am perfectly able to store fields in database, but i am a bit confused about the way i am doing. is there any other better way to do the same. and if i have a single form with ten fields, and i want to store them in 2 tables, how can do that.

HERE GOES MY HTML CODE

 <form id="formElem" name="formElem" action="/register/register" method="post">
                    <fieldset class="step">
                        <legend>Account</legend>
                        <p>
                            <label for="username">User name</label>
                            <input id="username" name="username" />
                        </p>
                        <p>
                            <label for="email">Email</label>
                            <input id="email" name="email" placeholder="info@tympanus.net" type="email" AUTOCOMPLETE=OFF />
                        </p>
                        <p>
                            <label for="password">Password</label>
                            <input id="password" name="password" type="password" AUTOCOMPLETE=OFF />
                        </p>
       ......
       ......

And here is my Action Function:-

public function executeRegister(sfWebRequest $request)
     {
       if ($request->isMethod('post'))
     echo $request->getParameter('password');exit;

         $this->redirect('user/login');
      }
  • 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-27T10:32:37+00:00Added an answer on May 27, 2026 at 10:32 am

    You should use sfForm to handle form validation. If you use Doctrine for your models then it will be even easier because you can generate all the basics based on the schema definition.

    Regardless when using sfForm your action would look something like the following:

    public function executeSave(sfRequest $request)
    {
       $this->form = new MyFormThatExtendsSfForm();
       if($request->isMethod('post')){
          $this->form->bind($request->getParameter($this->form->getName()));
          if($this->form->isValid()){
             // the array of values passed in the form
             $values = $this->form->getValues();
    
             // do your save logic here
             // if its a doctrine form this logic will look simply like
             // $this->form->save();
    
             // redirect to your success action
             $this->redirect($successUrl);
          }
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Symfony, trying to create a database structure through build-model then
I'm new to Symfony and I'm going through the Jobeet tutorial v1.4 for Doctrine.
i am trying to setup a new symfony framework project on ubuntu by following
I am new to symfony 2. I am trying to use custom repository in
I am new to symfony framework. I am trying to populate the city_id form-field
I'm new to the world of PHP frameworks and, after some initial investigation, came
I have set up some custom symfony project-level settings in the file config/project.yml following
I have some problem while configuring symfony project on the production server. When I
I am new to symfony,I want to create a application using Symfony framework using
i'm trying to do a complex query with Criteria in a Symfony project using

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.