當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Form_Element_File::getDecorator方法代碼示例

本文整理匯總了PHP中Zend_Form_Element_File::getDecorator方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Form_Element_File::getDecorator方法的具體用法?PHP Zend_Form_Element_File::getDecorator怎麽用?PHP Zend_Form_Element_File::getDecorator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Form_Element_File的用法示例。


在下文中一共展示了Zend_Form_Element_File::getDecorator方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setMethod("POST");
     $name = new Zend_Form_Element_Text("name");
     $name->setRequired();
     $name->setLabel("material name:");
     $name->setAttrib("placeholder", "Enter material name");
     $name->addValidator(new Zend_Validate_Alnum("true"));
     $name->setAttrib("class", "form-control");
     $name->getDecorator("Label")->setOption("class", "control-label");
     $name->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $name->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $path = new Zend_Form_Element_File('path');
     $path->setLabel('Select File:');
     $path->setRequired();
     $path->setAttrib("class", "form-control");
     $path->setAttrib("class", "file-loading");
     $path->getDecorator("Label")->setOption("class", "control-label");
     $path->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $path->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $course = new Zend_Form_Element_Select('cid');
     $course->setLabel('Course Name:');
     //$course ->setMultiOptions(array( '5'=>'a','6'=>'c'));
     $course->setRequired(true)->addValidator('NotEmpty', true);
     $course->setAttrib("class", "form-control");
     $course->getDecorator("Label")->setOption("class", "control-label");
     $course->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $course->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $type = new Zend_Form_Element_Select('tid');
     $type->setLabel('Material Type:');
     //$type->setMultiOptions(array( '1'=>'pdf','2'=>'ppt'));
     $type->setRequired(true)->addValidator('NotEmpty', true);
     $type->setAttrib("class", "form-control");
     $type->getDecorator("Label")->setOption("class", "control-label");
     $type->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $type->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $mdate = new Zend_Form_Element_Hidden("mdate");
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setAttrib("class", "btn btn-xl center-block");
     //$submit->setAttrib("class", "btn");
     $this->addElements(array($name, $path, $course, $type, $mdate, $submit));
 }
開發者ID:abeinoo,項目名稱:Zend,代碼行數:43,代碼來源:Materials.php

示例2: init

 public function init()
 {
     $this->setName('f3')->setAttrib('enctype', 'multipart/form-data')->setMethod('post')->setAttribs(array('onsubmit' => 'return kiem_tra()', 'name' => 'f3'));
     $baseUrl = Khcn_View_Helper_GetBaseUrl::getBaseUrl();
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload file')->setRequired(true)->setDescription('(*.xlsx, *.xls)<br/> Click <a href="' . $baseUrl . '/../application/templates/admin/files/bai_bao_khoa_hoc_import.xlsx">here</a> to download sample file.')->setDestination(BASE_PATH . '/upload/files/temp/')->addValidator(new Zend_Validate_File_Extension(array('xls', 'xlsx')))->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'))))->setAttribs(array('id' => 'file'));
     $file->getDecorator('Description')->setOption('escape', false);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Lưu vào csdl')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
     $this->addElements(array($file, $submit));
     $this->addDisplayGroup(array('submit'), 'import', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'import')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'import_dt')), 'Form'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:13,代碼來源:Import.php

示例3: testDefaultDecoratorsContainDescription

 public function testDefaultDecoratorsContainDescription()
 {
     $element = new Zend_Form_Element_File('baz');
     $decorators = $element->getDecorator('Description');
     $this->assertTrue($decorators instanceof Zend_Form_Decorator_Description);
 }
開發者ID:omusico,項目名稱:logica,代碼行數:6,代碼來源:FileTest.php

示例4: testCallbackFunctionAtHtmlTag

 /**
  * @group GH-247
  */
 public function testCallbackFunctionAtHtmlTag()
 {
     $this->assertEquals(array('callback' => array('Zend_Form_Element_File', 'resolveElementId')), $this->element->getDecorator('HtmlTag')->getOption('id'));
 }
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:7,代碼來源:FileTest.php


注:本文中的Zend_Form_Element_File::getDecorator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。