/
loaivai.php
40 lines (32 loc) · 1.3 KB
/
loaivai.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
class Form_Loaivai extends Zend_Form{
public function init(){
$this->setDisableLoadDefaultDecorators(true);
$this->setDecorators(array(
array('ViewScript', array('viewScript' =>'form/loaivai_layout.phtml')),
'Form'
));
$ls= new Model_Loaisoi();
$arr = $ls->getAll();
$options = array();
foreach ($arr as $item)
{
$name = $item['MaSoi'];
$options[$name] = $item['TenSoi'];
}
$tenloaivai= $this->createElement('text', 'tenloaivai', array('decorators' => array('ViewHelper'),));
$masoi = $this->createElement('select', 'masoi',array('multioptions'=>$options,'decorators' => array('ViewHelper'),));
$them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'),'label'=>'Thêm'));
$masoi->setAttrib('class', 'formEdit');
$this->addElement($tenloaivai)
->addElement($masoi)
->addElement($them)
;
// $this->addElement('submit', 'nhap', array(
// 'decorators' => array(
// 'ViewHelper'
// ),
// 'label' => 'NháºÂp'
// ));
}
}