comment j'afficher le nom au lieu de code dans une Element_Text
salut,
en faite j'ai un souci concerne l'affichage d'un nom de represantant au lieu de code voilà mon code
Code:
1 2 3 4 5 6 7 8 9 10
| $representative = new Zend_Form_Element_Text('representative');
$representative->setLabel(Zend_Registry::get('Zend_Translate')->translate('representative'))
->setRequired(true)
->addValidator('notEmpty')
->addFilter('StripTags')
->addFilter('StringTrim')
->setValue(Admin_Models_RepresentativeTools::getRepresentativeNamebyrepresentativecode($this->element->representative));
$representative->getDecorator(('label'))->setOption('tag', 'span');
$this->addElement($representative); |
et dans le view j'ai mis ça :
Code:
1 2 3 4
| <div class="row">
<div class="col-md-2"><?php echo $this->element->representative->renderLabel(); ?></div>
<div class="col-md-2"><?php echo $this->element->representative->renderViewHelper(); ?></div>
</div> |
Merci de vous aide