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


PHP Zend_Form_Element_File::setDisableTranslator方法代码示例

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


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

示例1: testTranslatingValidatorErrors

 public function testTranslatingValidatorErrors()
 {
     require_once 'Zend/Translate.php';
     $translate = new Zend_Translate('array', array('unused', 'foo' => 'bar'), 'en');
     $this->element->setTranslator($translate);
     $adapter = $this->element->getTranslator();
     $this->assertTrue($adapter instanceof Zend_Translate_Adapter_Array);
     $adapter = $this->element->getTransferAdapter();
     $adapter = $adapter->getTranslator();
     $this->assertTrue($adapter instanceof Zend_Translate_Adapter_Array);
     $this->assertFalse($this->element->translatorIsDisabled());
     $this->element->setDisableTranslator($translate);
     $this->assertTrue($this->element->translatorIsDisabled());
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:14,代码来源:FileTest.php

示例2: _createFileuploadField

 /**
  * Method shows the fields for file uploads by looking in config file
  * @return <Zend_Element>
  */
 private function _createFileuploadField()
 {
     // get path to store files
     $tempPath = $this->_config->form->first->temp;
     if (true === empty($tempPath)) {
         $tempPath = APPLICATION_PATH . '/workspace/tmp/';
     }
     // get allowed filetypes
     $filetypes = $this->_config->publish->filetypes->allowed;
     if (true === empty($filetypes)) {
         $filetypes = 'pdf,txt,html,htm';
     }
     //get allowed file size
     $maxFileSize = (int) $this->_config->publish->maxfilesize;
     if (true === empty($maxFileSize)) {
         $maxFileSize = 1024000;
         //1MB
     }
     // Upload-fields required to enter second stage
     $requireUpload = $this->_config->form->first->require_upload;
     if (true === empty($requireUpload)) {
         $requireUpload = 0;
     }
     //file upload field(s)
     $fileupload = new Zend_Form_Element_File('fileupload');
     $fileupload->setDisableTranslator(true)->setLabel('fileupload')->setDestination($tempPath)->addValidator('Size', false, $maxFileSize)->setMaxFileSize($maxFileSize)->addValidator('Extension', false, $filetypes)->setValueDisabled(true)->setAttrib('enctype', 'multipart/form-data');
     if (1 == $requireUpload) {
         if (!isset($this->_session->fulltext) || $this->_session->fulltext == '0') {
             $fileupload->setRequired(true);
         }
     } else {
         $fileupload->setRequired(false);
     }
     $this->addElement($fileupload);
     $this->addSubmitButton('addAnotherFile', 'addAnotherFile');
     $comment = $this->createElement('textarea', 'uploadComment');
     $comment->setDisableTranslator(true);
     $comment->setLabel('uploadComment');
     $this->addElement($comment);
     $group = array($fileupload->getName(), 'addAnotherFile', $comment->getName());
     return $group;
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:46,代码来源:PublishingFirst.php


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