【发布时间】:2014-06-01 12:55:01
【问题描述】:
我正在尝试使用 zend 装饰器来使用自定义容器并在我的元素上添加 css 类。
$form->setElementDecorators(array(
'viewHelper',
'Errors',
array('Label'),
array(
array('row'=>'HtmlTag'),
array('tag'=>'div', 'class'=>'col-md-6')
)
));
$form->setDecorators(array(
'FormElements',
array(
array('data'=>'HtmlTag'),
array('tag'=>'div', 'class'=>'row')
),
'Form'
));
有没有办法直接在我的输入上添加一个 css 类? <input class="form-control">
有没有办法将标签和输入封装在2个div中?
其实我有的是
<div class="col-md-6">
<label></label>
<input>
</div>
我想要的是
<div class="col-md-6">
<div class="form-group">
<label></label>
<input class="form-control">
</div>
</div>
我还可以在哪里找到有关要传递给 setElementDecorators() 函数的数组的文档?
谢谢
【问题讨论】:
标签: zend-framework zend-form zend-decorators