Blog Image

Set widget label from action file in symfony 1.4

In Action File

==========================================================

$this->form = new youFormclassname();

To set individual Label

$this->form->getWidget(‘widgetname’)->setLabel(‘widget Custom label’);

To set multiple field label

$this->form->getWidgetSchema()->setLabels(array(
‘field_name_1’    => ‘Field 1 Custom Lable’,

‘field_name_2’    => ‘Field 2 Custom Lable’,

}

++++++++++++++++++++++++++++++++++++++

In Template File

============================================

<?php echo $form[‘field_name_1’]->renderLabel() ?>



Author: admin

Vinod Ram has been in Software Industry since 2006 and has experience of over 16 years in Software Development & Project Management domain specialised majorly in LAMP stack & Open Source Technology, building enterprise level Web based Application, Large Database driven and huge traffic Websites and Project Management. He loves to write information articles and blog to share his knowledge and experience with the outside world and help people to find solution for their problems.