當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。