I'm adding a form element like so:
$this->addElement('text', 'product_name', array(
'label' => 'product name',
'... )
);
I'd like to reference the product_name label in the ViewScript decorator script as I'm doing it with product_name text input <?php echo $this->form->product_name; ?> but the label tag rendered by the "addElement" have no "name" attribute. How can I solve the problem?
Option 1: Use Zend manual and check out the section "Rendering Individual decorators" to see how to render your label alone.
Option 2: You can skip the label part, remove its decorator in the form code as follows, and then add it in the form's view script directly with styles you want to add:
Then, in the view script: