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


PHP Zend_Form_Element_File::setMultiFileForQool方法代码示例

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


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

示例1: getFormElement

 function getFormElement($v, $value = '')
 {
     $this->toTpl('hasForm', 1);
     $v = $this->doQoolHook('front_pre_getformelement_element', $v);
     $value = $this->doQoolHook('front_pre_getformelement_value', $value);
     switch ($v['value']) {
         case "editor":
             $this->loadEditorBtns();
             $this->toTpl("loadEditor", 1);
             $this->toTpl("isEditor", 1);
             $element = new Zend_Form_Element_Textarea($v['name']);
             $element->setAttrib('class', 'editor span12');
             if ($value != '') {
                 $element->setValue($value);
             }
             break;
         case "fileinput":
             $element = new Zend_Form_Element_File($v['name']);
             $element->setAttrib('class', 'input-file');
             break;
         case "captcha":
             $element = new Zend_Form_Element_Captcha($v['name'], array('label' => $this->t("Please verify you are a human"), 'captcha' => $config->site->captcha_adapter, 'captchaOptions' => array('captcha' => $config->site->captcha_adapter, 'wordLen' => 6, 'timeout' => 300)));
             return $element;
             break;
         case "multifileinputs":
             $element = new Zend_Form_Element_File($v['name']);
             $element->setAttrib('class', 'input-file');
             $element->setMultiFile(10);
             break;
         case "multifileinput":
             $name = $v['name'] . "[]";
             $element = new Zend_Form_Element_File($name);
             $element->setAttrib('class', 'input-file');
             $element->setAttrib('multiple', 'multiple');
             $element->setMultiFileForQool(1);
             $this->toTpl('filelist', true);
             break;
         case "checkbox":
             $element = new Zend_Form_Element_Checkbox($v['name']);
             $element->setAttrib('class', 'checkbox');
             $element->setValue($value);
             break;
         case "editarea":
             $this->toTpl('editarea', 1);
             $element = new Zend_Form_Element_Textarea($v['name']);
             $element->setAttrib('class', 'editarea span12');
             $element->setAttrib('id', 'editarea');
             $element->setAttrib('style', 'height:500px');
             if ($value != '') {
                 $element->setValue($value);
             }
             break;
         case "password":
             $element = new Zend_Form_Element_Password($v['name']);
             break;
         case "textarea":
             $element = new Zend_Form_Element_Textarea($v['name']);
             $element->setAttrib('class', 'span9');
             $element->setAttrib('style', 'height:80px');
             if ($value != '') {
                 $element->setValue($value);
             }
             break;
         case "hidden":
             $element = new Zend_Form_Element_Hidden($v['name']);
             $element->setValue($value);
             $element->setDecorators(array("ViewHelper"));
             break;
         case "textinput":
             $element = new Zend_Form_Element_Text($v['name']);
             if ($value != '') {
                 $element->setValue($value);
             }
             break;
         case "selectbox":
             $element = new Zend_Form_Element_Select($v['name']);
             if ($v['use_pool'] && method_exists($this, $v['use_pool'])) {
                 if ($v['pool_type'] != '0') {
                     $this->pool_type = $v['pool_type'];
                 }
                 if ($v['novalue']) {
                     $element->addMultiOption(0, $this->t('No Selection'));
                 }
                 foreach ($this->{$v}['use_pool']() as $ko => $vo) {
                     if ($v['noself'] && $vo['id'] == $v['noself']) {
                     } else {
                         $element->addMultiOption($vo['id'], $vo['title']);
                     }
                 }
                 if ($value != '') {
                     $element->setValue($value);
                 }
             }
             break;
         case "multiselectbox":
             $element = new Zend_Form_Element_Multiselect($v['name']);
             if ($v['use_pool'] && method_exists($this, $v['use_pool'])) {
                 if ($v['pool_type'] != '0') {
                     $this->pool_type = $v['pool_type'];
                 }
//.........这里部分代码省略.........
开发者ID:basdog22,项目名称:Qool,代码行数:101,代码来源:Action.php


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