2

With symfony, I use widgets to display a form.

Once everything is filled and validated, I land on a "review" page where all the information the user entered appears as text (<span>). To do this, I created a formatter (instead of table, I called it "review"). The formatter spits out <span> instead of <input>

It works great for basic inputs, but when it comes to Choices, or Dates, it's not working super great... I feel there is another way to have a review page without having to write a whole page just for this?

Any ideas?

3 Answers 3

1

Unfortunately, I find it sad that there is no concept of displaying the data already posted on a page with Symfony.

Using getValues() to recreate the whole UI with the same exact design with the exception of using <span> instead of <input> doesn't keep the code DRY at all...

I decided to create a formatter as I mentioned in my question with adding some "if" clause to make sure everything displays correctly.

Sign up to request clarification or add additional context in comments.

Comments

0

You could adjust your formatter to handle other types of form elements, or you could try using some type of lightbox before the form is submitted. But in the end, I'd just go ahead and write that extra page. Everything your trying to do sounds so much more complicated than just a separate page.

Comments

0

I find this approach such a hassle. Why don't you pass the result of $form->getValues() to the view and output them however you want in the template?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.