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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:54:49+00:00 2026-05-26T14:54:49+00:00

I am using a propel form to allow a user to create an account,

  • 0

I am using a propel form to allow a user to create an account, the form has two parts; the entering and then the preview.

On my preview page I declare the values of the form as usual and these are provided by the previous form

public function configure() {
    //Preview page no fields are displayed anyway xD
    $this->useFields(array('email', 'user_gender_id', 'search_gender_id', 'content', 'age', 'location'));

But instead of outputting the fields I am trying to render the values on the page:

<?php echo $form->renderHiddenFields(); ?>

    <?php foreach($form as $field): ?>

        <?php if(!$field->isHidden()): ?>
            <tr>
                <th><?php echo $field->renderLabel() ?></th>
                <td><?php echo $field->getValue(); ?></td>
            </tr>
        <?php endif; ?>

    <?php endforeach; ?>

<?php else: ?>

    <?php echo $form; ?>

<?php endif; ?>

Unfortunately for my sfWidgetFormPropelChoice / sfWidgetFormChoice fields it just outputs the chosen ID rather than a string representation of it.

Is there a proper way in Symfony to output the text representation of a widget’s value? Or do I have to hack something together? (any ideas?)

Many thanks,

Pez,

  • 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-26T14:54:50+00:00Added an answer on May 26, 2026 at 2:54 pm

    I got around this problem by doing the following:

    <td><?php if(method_exists($field->getWidget(), "getChoices")) {
        $choices = $field->getWidget()->getChoices();
         echo $choices[$field->getValue()];
    } else
         echo $field->getValue();
    ?></td>
    

    I hope this is of use to someone as it has been driving me crazy!

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

Sidebar

Related Questions

I'm using jquery to validate an asp.net form (content within a master page). The
I'm using Symfony 1.2 in a standard Propel form class. public function configure() {
I am using Symfony 1.4 and Propel as ORM. I have created a form
we using symfony 1.0. We have an module work with Propel objects. The sql-querys
First post here... I normally develop using PHP and Symfony with Propel and ActionScript
I am writing a query using the Propel ORM The query is of the
I am using SF 1.2.9 (with Propel ORM), to build a website. I have
Is there a good way to check a form input using regex to make
I am using SF 1.4.8 with Propel ORM for a project. I have an
I have a form on an HTML page with multiple submit buttons that perform

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.