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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:02:53+00:00 2026-06-09T13:02:53+00:00

I have tried a lot and have not yet able to find solution to

  • 0

I have tried a lot and have not yet able to find solution to this problem. i am not sure if thats possible or not.

I have one table called Student then table called Assigment and Solutions

Now there are questions Stored in Assignment Table which are common to all students. But different student will submit different solutions.

On the form i want to have label as Question text and then text box as solution to that question.

IN the beginning i have the empty answers in database.

I am confused how can i use symfony to build this form

Becasue all solutions will be submiited togetehr with one submit button

Class AssignmentFormType{

$builder-> add('answer','collection' ....)

This is working fine but only thing here i want is to display that QuestionText as label for that Answer and i am not able to find that for 1 week

  • 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-09T13:02:55+00:00Added an answer on June 9, 2026 at 1:02 pm

    What you are trying to do is to dynamically create a form element based on information from your entity (i.e. setting label = $entity->getQuestion)

    Two approaches:

    A. Dynamic forms

    http://symfony.com/doc/master/cookbook/form/dynamic_form_generation.html

    Basically involves setting up a listener then using it to create your form element with access to each individual entity. Bit of a pain but it works.

    B. Inside of the form template

    Since all you want to do is to change the label then it might be easier to just set it inside of your form template. Something like:

    {{ form_label(form.assignment, form.assignment.vars.value.question) }}
    

    The .data should give you the actual assignment entity from which you can pull the question.

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

Sidebar

Related Questions

I have tried searching over the internet about this problem but not able to
I have tried a lot but not been able to understand the steps involved
I have searched a lot and tried much but I can not find the
I have tried a lot of solutions but it did not work for me
Have tried to find solutions for this and can't really come up with anything.
I have tried a few things to solve this problem but I can't seem
I have seen a lot of people with this error and no solution seems
I have searched a lot about UTF8 decoding, but not found the answer yet.
I'm not hugely familiar with a lot of WPF yet, so if this query
I have a very weird problem and has not been able to solve it

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.