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

  • Home
  • SEARCH
  • 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 7013381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:22:47+00:00 2026-05-27T22:22:47+00:00

I think its a simple question. Its about outputting errors. This is my twig

  • 0

I think its a simple question. Its about outputting errors.
This is my twig file:

    <table>
        <tr>
            <td>{{ form_label(form.dueDate) }}</td>
            <td>{{ form_widget(form.dueDate) }}</td>
            <td>{{ form_errors(form.dueDate) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.task) }}</td>
            <td>{{ form_widget(form.task) }}</td>
            <td>{{ form_errors(form.task) }}</td>
        </tr>
    </table>

Now each error displays (td with form_errors()) as:

< ul>< li>This value should not be blank< /li>< /ul>

My question is: I want to output error as plain text (without ul and li).

I know there is an example like this:

{% for error in errors %}
    {{ error.message }}        
{% endfor %}

But this will output errors one after another. I want to display them where specific input is:

< td>{{ myErrorFor form.dueDate }}< /td>

Big thanks for any help

  • 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-27T22:22:48+00:00Added an answer on May 27, 2026 at 10:22 pm

    You can customize how form errors render by providing your own form theme with a field_errors block.

    You can do this for just the current template:

    {# tell the form to look for theme blocks in the current template #}
    {% form_theme form _self %}
    
    {% block field_errors %}
    {% for error in errors %}
    {{ error.messageTemplate|trans(error.messageParameters, 'validators') }}<br>
    {% endfor %}
    {% endblock %}
    
    {# the rest of your template... #}
    

    Or by defining a global form theme in config.yml:

    twig:
        form: { resource: "::form_theme.html.twig" }
    

    In this case you would want to move the field_errors block above to app/Resources/views/form_theme.html.twig and the form_theme tag is no longer necessary.

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

Sidebar

Related Questions

I have a simple question about sending a file (XML file) from my webapp
This is a rather simple question, and I think it breaks down to whether
This is the URL. http://www.tumblr.com/ I think that its based on prototype, and is
Hi this question or problem i have its very hard i have search and
I would like your suggestion about this problem... To make it simple, I'll consider
I'm learning the basics of programming here (C#) but I think this question is
This question is not about timing something accurately on Windows (XP or better), but
I've created a question about this a few days . My solution is something
Based on a simple test I ran, I don't think it's possible to put
Does anyone know off a way or maybe think its possible to connect Node.js

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.