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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:39:08+00:00 2026-06-15T19:39:08+00:00

I am working on a form quite complicated. This form is based on an

  • 0

I am working on a form quite complicated.

This form is based on an OngletFichier Entity with its form Builder :


$builder
->add('traitement')
->add('ligneEntetes');
$builder->add('colonnesOnglet', 'collection', array('type' => new ColonneOngletType()
));

As you can see, in this Entity Form, I got a list of ColonneOnglet which is an other entity.


It looks like something like that :

Entity Form

  • SimpleAttribute of OngletFichier (text input)
  • SimpleAttribute of OngletFichier (text input)
  • ColonneOnglet (which have its own attributes, its own input)
  • ColonneOnglet (which have its own attributes, its own input)
  • ColonneOnglet (which have its own attributes, its own input)

I need to define a special form theme for each ColonneOnglet to organize its inputs, and to put it in red or not depending on one of its attribute.

I am quite lost with form theming.

I found an example but I don’t know if it can answer my problem : http://symfony2-document.readthedocs.org/en/latest/cookbook/form/create_custom_field_type.html

Thanks in advance for helping me !

EDIT :
http://symfony.com/doc/current/cookbook/form/form_customization.html#how-to-customize-an-individual-field
This works easily !

  • 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-15T19:39:10+00:00Added an answer on June 15, 2026 at 7:39 pm

    The article you’ve found is good, but I think this section of the manual fits better: http://symfony.com/doc/2.0/cookbook/form/form_customization.html#how-to-customize-an-individual-field
    So the easiest way is to create separate file with form theme and import it into template using
    form_theme form 'Path:To:theme.html.twig'. You can also define your styling inside the template itself and import using this directive: form_theme form _self, but be aware that in order for this to work the template must extend another one.

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

Sidebar

Related Questions

I'm working on a form to add new Customers. In this form the users
I'm currently working on a reasonably complicated data input form, based around ASP.NET Web
I've been struggling for quite a while to get this feature working: I want
I'm quite busy with working with the Zend_Form object. I'm building a form which
So I have a form working quite well with MVC 3, DataAnnotations and Unobtrusive
Can't for the life of me figure this out. The form validation STOPS working
I have been working on quite a complex accordion/form recently and have a select
Im trying to get a form working in Internet Explorer. I see that when
My form is working fine with the validations being done by PHP. I have
Im working on a form that needs a password that is between 6 and

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.