我正在浏览stackoverflow以搜索我的问题的答案。基本上我想使用Zend_Form将div放在输入框右下方的div中。我发现下面的代码添加div但现在我想要另一个内部。我需要实现相当于
的html<div id = "parentDiv">
<div id = "innerDiv"></div>
</div>
代码取自stackoverflow上的另一个问题,不记得是哪一个,请原谅我。
$this->addElement(
'hidden',
'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();
答案 0 :(得分:-1)
$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;'
)
)
)
)
);