开发者

zend framework Zend_Form div inside div

I was browsing stackoverflow in a search for an answer to my question. Basically i want to use Zend_Form to place a div inside a div right beneath an input box. I have found the code below to add a div but now i want another one inside. I need to achieve the html equivalent of

<div id = "parentDiv">
    <div id = "innerDiv"></div>
</div>

Code taken from another question here on stackoverflow, can't remember which one, please forgive me.

$this->addElement(
                'hidden',
               开发者_如何学Python 'suggestions',
                array(
                    'required' => false,
                    'ignore' => true,
                    'autoInsertNotEmptyValidator' => false,
                    'decorators' => array(
                        array(
                            'HtmlTag', array(
                                'tag' => 'div',
                                'id' => 'suggestions',
                                'class' => 'suggestionsBox',
                                'style' => 'display: none;'
                            )
                        )
                    )
                )
        );
        $this->suggestions->clearValidators();


just a guess, but try this:

$this->addElement(
                'hidden',
                'suggestions',
                array(
                    'required' => false,
                    'ignore' => true,
                    'autoInsertNotEmptyValidator' => false,
                    'decorators' => array(
                        array(
                            'HtmlTag', array(
                                'tag' => 'div',
                                'id' => 'suggestions',
                                'class' => 'suggestionsBox',
                                'style' => 'display: block;'
                            ),
                            'HtmlTag', array(
                                'tag' => 'div',
                                'id' => 'another',
                                'class' => 'suggestionsBox',
                                'style' => 'display: block;'
                            )
                        )
                    )
                )
        );
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜