本文整理汇总了PHP中Zend_View_Helper_Url类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Helper_Url类的具体用法?PHP Zend_View_Helper_Url怎么用?PHP Zend_View_Helper_Url使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_View_Helper_Url类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->_adminModel = new Application_Model_Admin();
$this->setMethod('post');
$this->setName('editproduct');
$this->setAction('');
//recupero il prodotto da modificare
//$this->_default = $this->_adminModel->getProdById($this->_id);
//nome del prodotto
$this->addElement('text', 'Nome', array('label' => 'Nome', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 25))), 'decorators' => $this->elementDecorators));
$this->addElement('text', 'DescrizioneBreve', array('label' => 'Descrizione Breve', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('StringLength', true, array(1, 250))), 'decorators' => $this->elementDecorators));
$this->addElement('textarea', 'DescrizioneLunga', array('label' => 'Descrizione Estesa', 'cols' => '60', 'rows' => '10', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 2500))), 'decorators' => $this->elementDecorators));
$this->addElement('multiCheckbox', 'Componenti', array('label' => 'Componenti', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
$urlHelper = new Zend_View_Helper_Url();
$url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addcomponent'), 'default');
$this->addElement('Note', 'AddComponenti', array('value' => '<a href="' . $url . '">Inserisci un nuovo componente</a>', 'decorators' => $this->elementDecorators));
$this->addElement('multiCheckbox', 'Ntbu', array('label' => 'Note tecniche di buon uso', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
$urlHelper = new Zend_View_Helper_Url();
$url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addntbu'), 'default');
$this->addElement('Note', 'AddNtbu', array('value' => '<a href="' . $url . '">Inserisci una nuova ntbu</a>', 'decorators' => $this->elementDecorators));
$this->addElement('text', 'Cilindrata', array('label' => 'Cilindrata', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('Between', true, array(0, 10000))), 'decorators' => $this->elementDecorators));
$this->addElement('text', 'Potenza', array('label' => 'Potenza (kW)', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
$this->addElement('text', 'MassaVuoto', array('label' => 'Massa a vuoto', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
$this->addElement('text', 'VelocitaMax', array('label' => 'Velocità massima', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
$this->addElement('submit', 'add', array('label' => 'Modifica Prodotto', 'decorators' => $this->buttonDecorators));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), array('Description', array('placement' => 'prepend', 'class' => 'formerror')), 'Form'));
}
示例2: init
public function init()
{
$this->setName('f2')->setMethod('post');
$thangOptions = Default_Model_Constraints::lichct_thang();
$thang = new Zend_Form_Element_Select('thang');
$thang->setLabel('Tháng (*)')->setValue(date('m'))->setRequired(true)->addMultiOptions($thangOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
$this->addElement($thang);
$tuanOptions = Default_Model_Constraints::lichct_tuan();
$tuan = new Zend_Form_Element_Select('tuan');
$tuan->setLabel('Tuần (*)')->setRequired(true)->addMultiOptions($tuanOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
$this->addElement($tuan);
$ngay_bat_dau = new Zend_Form_Element_Text('ngay_bat_dau');
$ngay_bat_dau->setLabel('Ngày bắt đầu (*)')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'ngay_bat_dau'));
$this->addElement($ngay_bat_dau);
$ngay_ket_thuc = new Zend_Form_Element_Text('ngay_ket_thuc');
$ngay_ket_thuc->setLabel('Ngày kết thúc (*)')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'ngay_ket_thuc'));
$this->addElement($ngay_ket_thuc);
$ghi_chu = new Zend_Form_Element_Textarea('ghi_chu');
$ghi_chu->setLabel('Ghi chú')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ghi_chu', 'class' => 'text-input textarea', 'rows' => 4));
$this->addElement($ghi_chu);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$this->addElement($submit);
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'lich-cong-tac', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElement($cancel);
$this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例3: init
public function init()
{
$this->setName('f2')->setMethod('post');
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int');
$ma = new Zend_Form_Element_Text('ma');
$ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToUpper')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input'));
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 250))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$ofSGUOptions = array("multiOptions" => array('1' => 'Thuộc', '0' => 'Không thuộc'));
$thuoc_sgu = new Zend_Form_Element_Radio('thuoc_sgu', $ofSGUOptions);
$thuoc_sgu->setRequired(true)->setLabel('Thuộc SGU')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'thuoc_sgu'));
$deptOptions = array("multiOptions" => array('1' => 'Khoa - Bộ môn TT', '0' => 'Phòng ban - Trung tâm'));
$la_khoa = new Zend_Form_Element_Radio('la_khoa', $deptOptions);
$la_khoa->setRequired(true)->setLabel('Loại đơn vị')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'la_khoa', 'class' => 'radio_inline'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'don-vi', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($id, $ma, $ten, $thuoc_sgu, $la_khoa, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'don_vi')), 'Form'));
}
示例4: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setAttrib('class', 'form_create_tai_lieu');
$this->addElement('Hidden', 'search', array('value' => 1));
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Chuyên đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$noi_dung = new Zend_Form_Element_Textarea('noi_dung');
$noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
$thoi_gian = new Zend_Form_Element_Text('thoi_gian');
$thoi_gian->setLabel('Ngày tổ chức')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'thoi_gian'));
$dia_diem = new Zend_Form_Element_Text('dia_diem');
$dia_diem->setLabel('Địa điểm')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$file = new Zend_Form_Element_File('file');
$file->setLabel('Upload file')->setDescription('(*.doc, *.docx, *.pdf , < 10MB )')->setDestination(BASE_PATH . '/upload/files/sinh_hoat_chuyen_de')->addValidator(new Zend_Validate_File_Extension(array('doc,docx,pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setLabel('Lưu và tiếp tục')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setLabel('Lưu và thoát')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'sinh-hoat-chuyen-de', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($ten, $noi_dung, $thoi_gian, $dia_diem, $file, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例5: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setAttrib('class', 'form_create_bai_bao');
$this->addElement('Hidden', 'search', array('value' => 1));
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên sản phẩm (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$so_luong_thanh_vien = new Zend_Form_Element_Text('so_luong_thanh_vien');
$so_luong_thanh_vien->setRequired(true)->setLabel('Số lượng thành viên')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'so_luong_thanh_vien'))->setAttrib('class', 'text-input small-input');
$mo_ta = new Zend_Form_Element_Textarea('mo_ta');
$mo_ta->setLabel('Nội dung')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta', 'class' => 'text-input textarea'));
$thong_tin = new Zend_Form_Element_Text('thong_tin');
$thong_tin->setRequired(true)->setLabel('Thông tin')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'thong_tin'))->setAttrib('class', 'text-input large-input');
$thangOptions = Default_Model_Constraints::lichct_thang();
$thang = new Zend_Form_Element_Select('thang');
$thang->setLabel('Tháng')->addMultiOptions($thangOptions)->setValue(date('m'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$namOptions = Default_Model_Constraints::years();
$nam = new Zend_Form_Element_Select('nam');
$nam->setLabel('Năm')->addMultiOptions($namOptions)->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$dot = new Zend_Form_Element_Text('dot');
$dot->setRequired(true)->setLabel('Đợt')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'dot'));
$file = new Zend_Form_Element_File('file');
$file->setLabel('Upload file')->setDescription('(*.doc, *.docx, *.pdf , < 10MB )')->setDestination(BASE_PATH . '/upload/files/bai_bao')->addValidator(new Zend_Validate_File_Extension(array('doc,docx,pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setLabel('Lưu và tiếp tục')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setLabel('Lưu và thoát')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'bai-bao', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($ten, $thong_tin, $mo_ta, $so_luong_thanh_vien, $thang, $nam, $dot, $file, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例6: init
public function init()
{
//$this->_adminModel = new Application_Model_Admin();
$this->setMethod('post');
$this->setName('addproduct');
$this->setAction('');
//nome del prodotto
$this->addElement('text', 'Nome', array('label' => 'Nome', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 25))), 'decorators' => $this->elementDecorators));
$this->addElement('select', 'idCategoria', array('label' => 'Categoria', 'required' => true, 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
$this->addElement('file', 'Foto', array('label' => 'Immagine', 'destination' => APPLICATION_PATH . '/../public/images/products', 'validators' => array(array('Count', false, 1), array('Size', false, 102400), array('Extension', false, array('jpg', 'gif'))), 'decorators' => $this->fileDecorators));
$this->addElement('text', 'DescrizioneBreve', array('label' => 'Descrizione Breve', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('StringLength', true, array(1, 250))), 'decorators' => $this->elementDecorators));
$this->addElement('textarea', 'DescrizioneLunga', array('label' => 'Descrizione Estesa', 'cols' => '60', 'rows' => '10', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 2500))), 'decorators' => $this->elementDecorators));
$this->addElement('multiCheckbox', 'Componenti', array('label' => 'Componenti', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
$urlHelper = new Zend_View_Helper_Url();
$url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addcomponent'), 'default');
$this->addElement('Note', 'AddComponenti', array('value' => '<a href="' . $url . '">Inserisci un nuovo componente</a>', 'decorators' => $this->elementDecorators));
$this->addElement('multiCheckbox', 'Ntbu', array('label' => 'Note tecniche di buon uso', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
$urlHelper = new Zend_View_Helper_Url();
$url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addntbu'), 'default');
$this->addElement('Note', 'AddNtbu', array('value' => '<a href="' . $url . '">Inserisci una nuova ntbu</a>', 'decorators' => $this->elementDecorators));
$this->addElement('text', 'Cilindrata', array('label' => 'Cilindrata', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('Between', true, array(0, 10000))), 'decorators' => $this->elementDecorators));
$this->addElement('text', 'Potenza', array('label' => 'Potenza (kW)', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
$this->addElement('text', 'MassaVuoto', array('label' => 'Massa a vuoto', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
$this->addElement('text', 'VelocitaMax', array('label' => 'Velocità massima', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
$this->addElement('submit', 'add', array('label' => 'Aggiungi Prodotto', 'decorators' => $this->buttonDecorators));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), array('Description', array('placement' => 'prepend', 'class' => 'formerror')), 'Form'));
}
示例7: init
public function init()
{
$this->setName('f2')->setMethod('post');
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int');
$ma = new Zend_Form_Element_Text('ma');
$ma->setLabel('Mã (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$mo_ta = new Zend_Form_Element_Textarea('mo_ta');
$mo_ta->setLabel('Mô tả')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta', 'class' => 'textarea', 'rows' => '4'));
$loai_lv = new Default_Model_LoaiLinhVuc();
$llvOptions = array("multiOptions" => $loai_lv->getMultiOptions());
$ma_loai = new Zend_Form_Element_Select('ma_loai', $llvOptions);
$ma_loai->setLabel('Loại lĩnh vực')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'linh-vuc', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($id, $ma, $ten, $mo_ta, $ma_loai, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'linh_vuc')), 'Form'));
}
示例8: init
public function init()
{
$this->setName('f3')->setMethod('get');
$linh_vuc = new Default_Model_LinhVuc();
$lv = $linh_vuc->getDSLV();
$lv = array('0' => '========= Tất cả =========') + $lv;
$lvOptions = array("multiOptions" => $lv);
$ma_linh_vuc = new Zend_Form_Element_Select('ma_linh_vuc', $lvOptions);
$ma_linh_vuc->setRequired(true)->setLabel('Lĩnh vực')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_linh_vuc'));
$nams = Default_Model_Constraints::nam();
$nams = array('0' => '== Tất cả ==') + $nams;
ksort($nams);
$namOption = array("multiOptions" => $nams);
$nam = new Zend_Form_Element_Select('nam', $namOption);
$nam->setLabel('Năm')->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'nam'));
$submit = new Zend_Form_Element_Submit('loc');
$submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'danh-sach-hdd'), null, true);
$reset = new Zend_Form_Element_Button('reset');
$reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($ma_linh_vuc, $nam, $submit, $reset));
// Element: order
$this->addElement('Hidden', 'order', array('order' => 10004));
// Element: direction
$this->addElement('Hidden', 'direction', array('order' => 10005));
$this->addDisplayGroup(array('ma_linh_vuc', 'nam', 'loc', 'reset'), 'group1', array('order' => 1, 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_hdd', 'style' => 'width : 65%')), 'Form'));
}
示例9: init
public function init()
{
$this->setName('f3')->setMethod('get');
$ma = new Zend_Form_Element_Text('ma');
$ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 70px'));
$ho = new Zend_Form_Element_Text('ho');
$ho->setLabel('Họ')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 100px'));
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 50px', 'id' => 'ten'));
$don_vi = new Default_Model_DonVi();
$dv = $don_vi->getDSDV();
$dv = array('0' => '=============== Tất cả ===============') + $dv;
$dvOptions = array("multiOptions" => $dv);
$ma_don_vi = new Zend_Form_Element_Select('ma_don_vi', $dvOptions);
$ma_don_vi->setRequired(true)->setLabel('Đơn vị')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_don_vi'));
$submit = new Zend_Form_Element_Button('loc', array('type' => 'submit'));
$submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'giang-vien', 'action' => 'index'), null, true);
$reset = new Zend_Form_Element_Button('reset');
$reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($ma, $ho, $ten, $ma_don_vi, $submit, $reset));
// Element: order
$this->addElement('Hidden', 'order', array('order' => 10004));
// Element: direction
$this->addElement('Hidden', 'direction', array('order' => 10005));
$this->addDisplayGroup(array('ma', 'ho', 'ten', 'ma_don_vi', 'loc', 'reset'), 'filter', array('order' => '0', 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_gv')), 'Form'));
}
示例10: init
public function init()
{
$this->setName('f2')->setMethod('post');
$nams = Default_Model_Constraints::nam();
$namOption = array("multiOptions" => $nams);
$nam = new Zend_Form_Element_Select('nam', $namOption);
$nam->setValue(date('Y'))->setLabel('Năm (*)')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'nam'));
$bizHDD = new Default_Model_Hdd();
$hdds = $bizHDD->getDSHDByNam(date('Y'));
if ($hdds == null) {
$hdsOptions = array("multiOptions" => array('-1' => '== Chưa thành lập =='));
} else {
$hdds = array('0' => '== Tất cả ==') + $hdds;
$hddsOptions = array("multiOptions" => $hdds);
}
$noi_nhan = new Zend_Form_Element_Select('noi_nhan', $hddsOptions);
$noi_nhan->setRequired(true)->setLabel('Hội đồng')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_nhan'))->setRegisterInArrayValidator(false);
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$noi_dung = new Zend_Form_Element_Textarea('noi_dung');
$noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'ds-mail-tb'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($nam, $noi_nhan, $tieu_de, $noi_dung, $submit, $cancel));
$this->addDisplayGroup(array('submit', 'cancel'), 'btn_submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例11: init
public function init()
{
$this->setName('form_giang_vien_create')->setMethod('post')->setAttrib('class', 'global_form form_giang_vien_create');
$this->addElement('Heading', 'account', array('value' => 'Thông tin giảng viên'));
$this->account->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
$this->addElement('Text', 'ma', array('label' => 'Mã giảng viên (*)', 'allowEmpty' => false, 'required' => true, 'filters' => array('StripTags'), 'validators' => array(array('StringLength', false, array(5, 10)), 'Alnum')));
$this->addElement('Heading', 'ma_giang_vien', array('label' => 'Mã giảng viên'));
$ho = new Khcn_Form_Element_Text('ho');
$ho->setLabel('Họ (*)')->setOptions(array('size' => '36'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 128))->setAttribs(array('id' => 'ho'));
$this->addElement($ho);
$ten = new Khcn_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setOptions(array('size' => '36'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 32))->setAttribs(array('id' => 'ten'));
$this->addElement($ten);
$email = new Khcn_Form_Element_Text('email');
$email->setLabel('Email (*)')->setRequired(true)->setOptions(array('size' => '36'))->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_EmailAddress())->setAttribs(array('id' => 'email'));
$this->addElement($email);
$don_vi = new Default_Model_DonVi();
$this->addElement('Select', 'ma_don_vi', array('label' => 'Đơn vị (*)', 'multiOptions' => $don_vi->getDSDVSGU(), 'value' => 1));
$hoc_vi = new Default_Model_HocVi();
$this->addElement('Select', 'ma_hoc_vi', array('label' => 'Học vị (*)', 'multiOptions' => $hoc_vi->getDSHV()));
$this->addElement('Text', 'chuc_vu', array('label' => 'Chức vụ', 'filters' => array('StripTags')));
$this->addElement('Text', 'so_dien_thoai', array('label' => 'Số điện thoại', 'filters' => array('StripTags')));
$this->addElement('Button', 'submit', array('label' => 'Lưu', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'default', 'controller' => 'index', 'action' => 'index'));
$this->addElement('Cancel', 'cancel', array('label' => 'Không lưu', 'onclick' => 'window.location.href="' . $link . '"', 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
$this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn');
}
示例12: themAction
public function themAction()
{
// TODO Auto-generated {0}::indexAction() default action
$form = new Admin_Form_DanhSachLop();
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'danh-sach-lop', 'action' => 'index'), null, true);
$form->submitCon->setLabel('Lưu và tiếp tục');
$form->submitExit->setLabel('Lưu và thoát');
$form->cancel->setLabel('Không lưu')->setAttribs(array('onclick' => 'window.location.href="' . $link . '"'));
$this->view->form = $form;
if (!$this->getRequest()->isPost()) {
return;
}
if (!$form->isValid($this->getRequest()->getPost())) {
return;
}
$values = $form->getValues();
$table = Khcn_Api::_()->getDbTable('danh_sach_lop', 'default');
$danh_sach_lop = $table->createRow();
$danh_sach_lop->setFromArray($values);
$danh_sach_lop->save();
$_SESSION['msg'] = 'Thành công !. Dữ liệu đã được lưu trữ .';
$_SESSION['type_msg'] = 'success';
if ($form->submitCon->isChecked()) {
$this->_redirect('/admin/danh-sach-lop/them');
} else {
$this->_redirect('/admin/danh-sach-lop/index');
}
}
示例13: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$quan_trong = new Zend_Form_Element_Select('quan_trong');
$quan_trong->setLabel('Quan Trọng')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$noi_bat = new Zend_Form_Element_Select('noi_bat');
$noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$image = new Zend_Form_Element_Image('image');
$image->setLabel('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
$trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
$trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$mo_ta_tom_tat = new Zend_Form_Element_Textarea('mo_ta_tom_tat');
$mo_ta_tom_tat->setLabel('Mô tả tóm tắt')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_tom_tat', 'class' => 'textarea', 'rows' => '4'));
$mo_ta_chi_tiet = new Zend_Form_Element_Textarea('mo_ta_chi_tiet');
$mo_ta_chi_tiet->setLabel('Mô tả chi tiết (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_chi_tiet', 'class' => 'text-input textarea'));
$pdf = new Zend_Form_Element_File('pdf');
$pdf->setLabel('Upload PDF')->setDescription('(*.pdf < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'tin-tuc', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($tieu_de, $quan_trong, $noi_bat, $photo, $image, $pdf, $trang_thai, $mo_ta_tom_tat, $mo_ta_chi_tiet, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'tin_tuc')), 'Form'));
}
示例14: init
public function init()
{
$this->setName('f2')->setMethod('post');
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input medium-input'));
$statusOptions = array("multiOptions" => array(1 => 'Thuộc SGU', 0 => 'Liên kết trang mạng'));
$is_sgu = new Zend_Form_Element_Radio('is_sgu', $statusOptions);
$is_sgu->setRequired(true)->setLabel('Liên kết')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$url = new Zend_Form_Element_Text('url');
$url->setLabel('Url (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$file = new Zend_Form_Element_File('file');
$file->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/small/images/lien_ket')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$maxOrder = Khcn_Api::_()->getDbTable('lien_ket', 'default')->getMaxOrderItem();
$order = new Zend_Form_Element_Text('order');
$order->setLabel('Thứ tự *')->setValue($maxOrder->order + 1)->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input tinysmall-input'));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$Url = new Zend_View_Helper_Url();
$link = $Url->url(array('module' => 'admin', 'controller' => 'lien-ket', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($ten, $is_sgu, $url, $file, $order, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'lien_ket')), 'Form'));
}
示例15: init
public function init()
{
$this->setName('f2')->setMethod('post')->setAttribs(array('id' => 'user'));
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int')->removeDecorator('label');
$username = new Zend_Form_Element_Text('ten_dang_nhap');
$username->setLabel('Tên đăng nhập (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 32))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 83%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ten_dang_nhap', 'class' => 'text-input'));
$password = new Zend_Form_Element_Password('mat_khau');
$password->setLabel('Mật khẩu (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mat_khau', 'class' => 'text-input'));
$repassword = new Zend_Form_Element_Password('mat_khau_2');
$repassword->setLabel('Nhập lại mật khẩu (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_Identical('mat_khau'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mat_khau_2', 'class' => 'text-input'));
$ho = new Zend_Form_Element_Text('ho');
$ho->setLabel('Họ (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 100))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 83%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ho', 'class' => 'text-input'));
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 20))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ten', 'class' => 'text-input'));
$ngay_sinh = new Zend_Form_Element_Text('ngay_sinh');
$ngay_sinh->setLabel('Ngày sinh (*)')->setDescription('(dd-mm-YYYY)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ngay_sinh', 'class' => 'text-input'));
$email = new Zend_Form_Element_Text('email');
$email->setLabel('Email (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_EmailAddress())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'email', 'class' => 'text-input'));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'index', 'action' => 'index'));
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($id, $username, $password, $repassword, $ho, $ten, $ngay_sinh, $email, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submitbtn', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}