当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Select::getDecorator方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Select::getDecorator方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Select::getDecorator方法的具体用法?PHP Zend_Form_Element_Select::getDecorator怎么用?PHP Zend_Form_Element_Select::getDecorator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Select的用法示例。


在下文中一共展示了Zend_Form_Element_Select::getDecorator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $this->setAction("assignCourse");
     $user = new Zend_Form_Element_Select('uid');
     $user->setLabel('Select User:');
     //$user ->setMultiOptions(array( '1'=>'programing languages','2'=>'graphics'));
     $user->setRequired(true)->addValidator('NotEmpty', true);
     $user->setAttrib("class", "form-control");
     $user->getDecorator("Label")->setOption("class", "control-label");
     $user->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $user->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $course = new Zend_Form_Element_Select('cid');
     $course->setLabel('Select Course:');
     //$course ->setMultiOptions(array( '1'=>'programing languages','2'=>'graphics'));
     $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");
     $registration_date = new Zend_Form_Element_Hidden("registration_date");
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setAttrib("class", "btn btn-xl center-block");
     //$submit->setAttrib("class", "btn");
     $this->addElements(array($user, $course, $registration_date, $submit));
 }
开发者ID:abeinoo,项目名称:Zend,代码行数:25,代码来源:CourseReuest.php

示例2: init

 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setMethod("POST");
     //$this->setAttrib("class", "form-group has-success ");
     //$this->setAttrib("role","form")
     $course_name = new Zend_Form_Element_Text("name");
     $course_name->setRequired();
     $course_name->setLabel("course name:");
     $course_name->setAttrib("placeholder", "Enter course name");
     $course_name->addValidator(new Zend_Validate_Alnum("true"));
     $course_name->setAttrib("class", "form-control");
     $course_name->getDecorator("Label")->setOption("class", "control-label");
     $course_name->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $course_name->getDecorator("Errors")->setOption("role", "alert");
     $course_name->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $category = new Zend_Form_Element_Select('catid');
     $category->setLabel('category:');
     //$category ->setMultiOptions(array( '1'=>'programing languages','2'=>'graphics'));
     $category->setRequired(true)->addValidator('NotEmpty', true);
     $category->setAttrib("class", "form-control");
     $category->getDecorator("Label")->setOption("class", "control-label");
     //$category->getDecorator("Label")->setOption("class", "color-org");
     $category->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $category->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $hours = new Zend_Form_Element_Text("hours");
     $hours->setRequired();
     $hours->setLabel("hours:");
     $hours->setAttrib("placeholder", "Enter Course hours");
     $hours->setAttrib("class", "form-control");
     $validator = $hours->addValidator(new Zend_Validate_Digits("true"));
     $hours->getDecorator("Label")->setOption("class", "control-label");
     $hours->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $hours->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $description = new Zend_Form_Element_Textarea("description");
     $description->setLabel('Description:');
     $description->setRequired();
     $description->setAttrib("rows", "10");
     $description->setAttrib("class", "form-control");
     $description->getDecorator("Label")->setOption("class", "control-label");
     $description->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $description->getDecorator("Errors")->setOption("style", " list-style-type:none");
     //$catid = new Zend_Form_Element_Hidden("catid");
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setAttrib("class", "btn btn-xl center-block");
     //$submit->setAttrib("class", "btn");
     $this->addElements(array($course_name, $category, $hours, $description, $submit));
 }
开发者ID:abeinoo,项目名称:Zend,代码行数:48,代码来源:Course.php

示例3: 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

示例4: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     $imageSrc = $options['imageSrc'];
     $dataId = $options['dataId'];
     $imgField = $options['imgField'];
     $isNewImage = $options['isNewImage'];
     $moduleName = $options['moduleName'];
     if ($dataId == '') {
         $pathTmp = "../../../../../data/images/" . $moduleName . "/tmp";
     } else {
         $pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp";
     }
     // hidden specify if new image for the news
     $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage));
     $newImage->removeDecorator('Label');
     $this->addElement($newImage);
     // Image for the product line
     $imageTmp = new Zend_Form_Element_Hidden($imgField . '_tmp');
     $imageTmp->removeDecorator('Label');
     $this->addElement($imageTmp);
     $imageOrg = new Zend_Form_Element_Hidden($imgField . '_original');
     $imageOrg->removeDecorator('Label');
     $this->addElement($imageOrg);
     // Name of the group of banner
     // Set the texte for the image
     $textDescription = new Zend_Form_Element_Textarea('BII_Text');
     $textDescription->setLabel($this->_view->getCibleText('form_banner_image_text_label'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextarea');
     $label = $textDescription->getDecorator('Label');
     $label->setOption('class', $this->_labelCSS);
     $textUrl = new Zend_Form_Element_Text('BII_Url');
     $textUrl->setLabel($this->_view->getCibleText('form_banner_image_texturl_label'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdText');
     $label = $textUrl->getDecorator('Label');
     $label->setOption('class', $this->_labelCSS);
     $groupImage = new Zend_Form_Element_Select('BI_GroupID');
     $groupImage->setLabel($this->_view->getCibleText('form_banner_image_group'))->setAttrib('class', 'largeSelect');
     $group = new GroupObject();
     $groupArray = $group->groupCollection();
     foreach ($groupArray as $group1) {
         $groupImage->addMultiOption($group1['BG_ID'], $group1['BG_Name']);
     }
     $label = $groupImage->getDecorator('Label');
     $label->setOption('class', $this->_labelCSS);
     // Image for the product line
     $imageView = new Zend_Form_Element_Image($imgField . '_preview', array('onclick' => 'return false;'));
     $imageView->setImage($imageSrc);
     $imagePicker = new Cible_Form_Element_ImagePicker($imgField, array('onchange' => "document.getElementById('imageView').src = document.getElementById('" . $imgField . "').value", 'associatedElement' => $imgField . '_preview', 'pathTmp' => $pathTmp, 'contentID' => $dataId));
     $imagePicker->removeDecorator('Label');
     $this->addElement($imageView);
     $this->addElement($imagePicker);
     $this->addElement($groupImage);
     $this->addElement($textDescription);
     $this->addElement($textUrl);
 }
开发者ID:anunay,项目名称:stentors,代码行数:54,代码来源:FormBannerImage.php


注:本文中的Zend_Form_Element_Select::getDecorator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。