Zend framework2 ZF2向元素添加样式

Zend framework2 ZF2向元素添加样式,zend-framework2,zend-form,Zend Framework2,Zend Form,嗨,除了添加类之外,还有没有其他方法可以向表单元素添加样式 $this->add(array( 'type' => 'Zend\Form\Element\Textarea', 'name' => 'notas', 'options' => array( 'label' => 'Notas', 'label_attributes' => array(

嗨,除了添加类之外,还有没有其他方法可以向表单元素添加样式

    $this->add(array(
        'type' => 'Zend\Form\Element\Textarea',
        'name' => 'notas',
        'options' => array(
            'label' => 'Notas',
            'label_attributes' => array(
                'class'  => 'label-wrapped'
            ),
        ),
    ));

谢谢

就是这样,但我仍然不知道如何添加几个样式

$this->add(array(
    'type' => 'Zend\Form\Element\Textarea',
    'name' => 'notas',
    'attributes' => array(
        'style'=>'width:100px',
    ),
    'options' => array(
        'label' => 'Notas',
        'label_attributes' => array(
            'class'  => 'label-wrapped'
        ),
    ),
));

“几种样式”是指宽度:100px;高度:80px;'?@我想他知道。但是我认为更好的方法是在视图中获取表单元素并在那里设置样式。我认为更好的方法是使用类并避免内联css:)是的@TimFountain就是这样,有时候我不想添加小的css配置,我不想创建类/css。