Sep
21
2012

Add CSS attributes to Symfony form label

SymfonyYou can add custom CSS attributes like class or id to Symfony form labels as following.


1
<?php echo $form['fieldname']->renderLabel(null, array('class'=>'anyclass')); ?>

Passing null as the first parameter won’t override the label text.

About the Author: Web Source Blog

Software Developer

1 Comment + Add Comment

  • Thanks for sharing.

Leave a comment

Email
Print
WP Socializer Aakash Web