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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:39:40+00:00 2026-05-27T03:39:40+00:00

I read about Symfony forms and i have simple question : i Make 2

  • 0

I read about Symfony forms and i have simple question :
i Make 2 templates “test” and test1 . I want to post forms values of
test to test1 and after to show them with echo.
In test i put:

form action="<?php echo url_for('maraton/test') ?>" method="POST" />
    <table> 
     <tr>
        <?php echo $form?>
     </tr>
      <tr>
        <td colspan="2">
          <input type="submit" value="submit" />
        </td>
      </tr>
     </table>
 </form>  

my action is :

public function executeTest(sfWebRequest $request)
  {
     $this->form = new AthletesForm();
  }

  public function executeTest1(sfWebRequest $request)
     {
        $this->form = new AthletesForm();

           if ($request->isMethod('post'))
             {
                $values = $this->form->getValues();
              }
  • 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-27T03:39:40+00:00Added an answer on May 27, 2026 at 3:39 am

    When creating a form you create it using an action :

    public function executeContact($request)
    {
      $this->form = new sfForm();
    }
    

    Then to display that form you use a template

    <?php echo $form->renderFormTag('foo/contact') ?> // this route "foo/contact" points to the action that will process the submit
      <table>
        <?php echo $form ?>
        <tr>
          <td colspan="2">
            <input type="submit" />
          </td>
        </tr>
      </table>
    </form>
    

    Then to process the form submit you use either the same action as above or a seperate action :

    if ($request->isMethod('post')) 
    // this if statement would be added if you used the same action to 
    // create / process the submit of the form 
    {
      $this->form = new sfForm(); // create an empty form object
      $this->form->bind($request->getParameter('contact')); 
      // merges (binds) the post data with the form
      if ($this->form->isValid()) // if the data is valid
      {
        // Handle the form submission
        $contact = $this->form->getValues();
        $name = $contact['name'];
    
        // Or to get a specific value
        $name = $this->form->getValue('name');
    
        // Do stuff
        // persist to database / save to file etc
        $this->redirect('foo/bar');
      }
    
    • 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, please don't scold me about this question. I read
Read about Server push here . I want to push data to client from
where can i read more about cakephp 2.0 features? cause i could find symfony
I read about this question on referencing one project into another and this question
Read this question today about safe and unsafe code I then read about it
I read about the Microsoft specific suffix i64 for integer constants. I want to
I read about GET and POST on the internet and I am quite confused
I read about JSON from internet but still i have not got the grasp
I read about unbind method object, and have known how to bind it to
I have read about partial methods in the latest C# language specification , so

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.