twig - How to get formatted HTML generated by Symfony -


i'm using symfony2 generate forms, or twig, uses symfony's functions, view looks this:

{{ form_start(form) }} {{ form_widget(form) }} {{ form_end(form) }} 

this generates html code without newlines or indentation. unreadable when html source code.

is there way force symfony/twig format generated html?

this link explains form customization in twig beautifully. there numerous ways of applying css styling form elements. example, if have form field name can add css class way:

{# render widget, add "foo" class #} {{ form_widget(form.name, {'attr': {'class': 'foo'}}) }} 

or label:

{{ form_label(form.name, 'your name', {'label_attr': {'class': 'foo'}}) }} 

then can use css classes render form elements per design. hope idea. docs , link provided in answer both useful in regard.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -