开发者

Setting the inner html text of a < span > element using Zend_Form_Decorators

I'm trying to set the inner html of the < span > tag here , so it looks like: Group

this is what i have so far:

    $form->addDisplayGroup(
                array(
                        ................
                ),
                'maingroup1',
                array(
                    'legend'=>'',
                    'disableDefaultDecorators'=> true,
                    'decorators'=> array('FormElements',
                                        array('FieldSet',array('class'=>'dashed-outline2')),
                                        array(array('SpanTag' => 'HtmlTag'), array('tag'=>'span','class' => 'group',)),
                                        array('HtmlTag',array('tag'=>'div','id'=>'group1','class'=>'group','openOnly'=> true))
                                        )
                )
            );

Is there a 开发者_运维技巧setter / property that I can use to set the inner text of the < span> element using Zend_form_decorators? Thanks.


When you have to start "hacking" or "figuring out how..." the best way to do something, its usually a hint you may be going down the wrong road. :-/

My best advice - based on how I understand your question - is that you might have to develop your own partial view for this display group. When you create your displaygroup, you can set your own decorators:

decorators' => array(
    array('ViewScript', array('viewScript' => 'path/to/viewscript.phtml')),
),

This will allow you the find-grained control you need. I know, it seems like a headache to have to create that view for your display group, but, IMHO, that is the 'best practice' to modify decorator contents when there is no clear way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜