Someone correct me if this is wrong :)

Looking at the Fieldset view helper there does not seem to be a way to
set the class:

// get legend
        $legend = '';
        if (isset($attribs['legend'])) {
            $legendString = trim($attribs['legend']);
            if (!empty($legendString)) {
                $legend = '<legend>'
                        . (($escape) ?
$this->view->escape($legendString) : $legendString)
                        . '</legend>' . PHP_EOL;
            }
            unset($attribs['legend']);
        }

As you can see no attributes are set on the legend, only the inner text is set.

I would use CSS instead and target the fieldsets legend tag like that.

Hope this helps :)

2009/3/26 ariawan <[email protected]>:
>
> Hi Guys,
>
> How do you set the class in legend? ie :
>
> $this->addDisplayGroup(array('day', 'month', 'year'), 'birthday', array(
>          'legend' => 'Birthday'
> ) );
>
> $this->setDisplayGroupDecorators(array(
>            'FormElements',
>            'Fieldset',
>            array(Legend, array('class' => 'someclassname'))
>            )
>        );
>
> This code above is not working .. I want the result to be
> <legend class="someclassname">Birthday</legend>
>
> All helps is appreciated .. Thank you so much.
>
> - Ari -
> --
> View this message in context: 
> http://www.nabble.com/zend_form-setting-class-in-%3Clegend%3E-tp22721211p22721211.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



-- 
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------

Reply via email to