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


PHP ezcInputForm::validateDefinition方法代码示例

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


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

示例1: __construct

 public function __construct($inputSource, $definition, $characterEncoding = null, $inputData = null, $useOverride = false)
 {
     if (($returnValue = ezcInputForm::validateDefinition($definition)) !== true) {
         throw new ezcInputFormInvalidDefinitionException($returnValue[1]);
     }
     $this->definition = $definition;
     $this->inputSource = $inputSource;
     $this->inputData = $inputData;
     if ($inputData === null || count($inputData) == 0) {
         $this->parseInput();
     } else {
         $this->parseInputFromData($useOverride);
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:14,代码来源:lhform.php

示例2: __construct

 /**
  * Constructs a new ezcInputForm for $inputSource with $definition.
  *
  * This method constructs a new ezcInputForm with three parameters. The
  * $inputSource parameter selects the input source and should be one of the
  * constants INPUT_GET, INPUT_POST or INPUT_COOKIE. The $definition
  * parameter is an array of ezcInputFormDefinitionElement items and
  * determines which input variables make up this form (see the example at
  * the top of this class). The last parameter, $characterEncoding is the
  * character encoding to use while retrieving input variable data. This
  * parameter has currently no function as it will depend on PHP 6
  * functionality which does not exist yet in the input filter extension.
  *
  * @throws ezcInputFormVariableMissingException when one of the required
  *         input variables is missing.
  * @throws ezcInputFormInvalidDefinitionException when the definition array
  *         is invalid or when the input source was invalid.
  *
  * @param int $inputSource
  * @param array(ezcInputFormDefinitionElement) $definition
  * @param string $characterEncoding
  */
 public function __construct($inputSource, $definition, $characterEncoding = null)
 {
     if (($returnValue = ezcInputForm::validateDefinition($definition)) !== true) {
         throw new ezcInputFormInvalidDefinitionException($returnValue[1]);
     }
     $this->definition = $definition;
     $this->inputSource = $inputSource;
     $this->parseInput();
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:31,代码来源:input_form.php

示例3: testValidateDefinitionFieldName

 public function testValidateDefinitionFieldName()
 {
     // The input field name should have a sane format
     $def = array('test' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'int'));
     self::assertEquals(true, ezcInputForm::validateDefinition($def));
     $def = array('' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'int'));
     self::assertEquals(array(ezcInputForm::DEF_FIELD_NAME_BROKEN, "The element name '' has an unsupported format. It should start with an a-z and followed by a-z0-9_"), ezcInputForm::validateDefinition($def));
     $def = array('^*(68769' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'int'));
     self::assertEquals(array(ezcInputForm::DEF_FIELD_NAME_BROKEN, "The element name '^*(68769' has an unsupported format. It should start with an a-z and followed by a-z0-9_"), ezcInputForm::validateDefinition($def));
     $def = array('foobar_42' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'int'));
     self::assertEquals(true, ezcInputForm::validateDefinition($def));
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:12,代码来源:tools_test.php


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