0
我是ZF2的新手,我正在重寫一個先前用ZF1寫過的簡單應用程序。我有一個表格,我想要自定義,因爲默認輸入/ textearea寬度和heigth不夠。在這裏我對我的形式的某些字段代碼:設置表單元素屬性
$this->add(array(
'name' => 'page',
'type' => 'Number',
'options' => array(
'label' => 'Page',
),
));
$this->add(array(
'name' => 'name',
'type' => 'Text',
'options' => array(
'label' => 'Name',
),
));
$this->add(array(
'name' => 'notes',
'type' => 'Textarea',
'options' => array(
'label' => 'Notes',
),
));
我如何可以指定一個寬度爲我的投入要素,屬性cols和rows爲我的textarea的?
我認爲這種方式更好,因爲我的表單不需要知道如何呈現它。 CSS將完成以下工作: 'class-name input {width:15em;}'''''class-name textarea {width:60em;高度:7em;}'=>它的工作原理。 –