本文整理汇总了PHP中FormValidator::FormValidator方法的典型用法代码示例。如果您正苦于以下问题:PHP FormValidator::FormValidator方法的具体用法?PHP FormValidator::FormValidator怎么用?PHP FormValidator::FormValidator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormValidator
的用法示例。
在下文中一共展示了FormValidator::FormValidator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormValidatorArray
/**
* Constructor.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $type string the type of check, either "required" or "optional"
* @param $message string the error message for validation failures (i18n key)
* @param $fields array all subfields for each item in the array, i.e. name[][foo]. If empty it is assumed that name[] is a data field
*/
function FormValidatorArray(&$form, $field, $type, $message, $fields = array(), $subArray = false)
{
parent::FormValidator($form, $field, $type, $message);
$this->_fields = $fields;
$this->_subArray = $subArray;
$this->_errorFields = array();
}
示例2: FormValidatorArrayRadios
/**
* Constructor.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $type string the type of check, either "required" or "optional"
* @param $message string the error message for validation failures (i18n key)
* @param $radiofields array all the radio buttons to check.
* @param $twoDim boolean specify if if this is a 2 dimensional array
*/
function FormValidatorArrayRadios(&$form, $field, $type, $message, $radiofields, $twoDim = false)
{
parent::FormValidator($form, $field, $type, $message);
$this->twoDimenstion = $twoDim;
$this->_radiofields = $radiofields;
$this->_errorFields = array();
}
示例3: FormValidatorCustom
/**
* Constructor.
* The user function is passed the form data as its first argument and $additionalArguments, if set, as the remaining arguments. This function must return a boolean value.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $type string the type of check, either "required" or "optional"
* @param $message string the error message for validation failures (i18n key)
* @param $userFunction callable function the user function to use for validation
* @param $additionalArguments array optional, a list of additional arguments to pass to $userFunction
* @param $complementReturn boolean optional, complement the value returned by $userFunction
*/
function FormValidatorCustom(&$form, $field, $type, $message, $userFunction, $additionalArguments = array(), $complementReturn = false)
{
parent::FormValidator($form, $field, $type, $message);
$this->_userFunction = $userFunction;
$this->_additionalArguments = $additionalArguments;
$this->_complementReturn = $complementReturn;
}
示例4: FormValidatorDate
/**
* Constructor.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $type string the type of check, either "required" or "optional"
* @param $message string the error message for validation failures (i18n key)
* @param $dateFormat int the ValidatorDate date format to allow
* @param $dateScope string the minimum resolution of a date to allow
* @param $dateScope string the maximum resolution of a date to allow
*/
function FormValidatorDate(&$form, $field, $type, $message, $dateFormat = DATE_FORMAT_ISO, $dateScopeMin = VALIDATOR_DATE_SCOPE_YEAR, $dateScopeMax = VALIDATOR_DATE_SCOPE_DAY)
{
$validator = new ValidatorDate($dateFormat);
$this->_scopeMin = $dateScopeMin;
$this->_scopeMax = $dateScopeMax;
parent::FormValidator($form, $field, $type, $message, $validator);
}
示例5: FormValidatorReCaptcha
/**
* Constructor.
* @param $form object
* @param $userIp string IP address of user request
* @param $message string Key of message to display on mismatch
*/
function FormValidatorReCaptcha(&$form, $challengeField, $responseField, $userIp, $message)
{
parent::FormValidator($form, $challengeField, FORM_VALIDATOR_REQUIRED_VALUE, $message);
$this->_challengeField = $challengeField;
$this->_responseField = $responseField;
$this->_userIp = $userIp;
}
示例6: FormValidatorArrayCustom
/**
* Constructor.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $type string the type of check, either "required" or "optional"
* @param $message string the error message for validation failures (i18n key)
* @param $userFunction function the user function to use for validation
* @param $additionalArguments array optional, a list of additional arguments to pass to $userFunction
* @param $complementReturn boolean optional, complement the value returned by $userFunction
* @param $fields array all subfields for each item in the array, i.e. name[][foo]. If empty it is assumed that name[] is a data field
* @param $isLocaleField boolean
*/
function FormValidatorArrayCustom(&$form, $field, $type, $message, $userFunction, $additionalArguments = array(), $complementReturn = false, $fields = array(), $isLocaleField = false)
{
parent::FormValidator($form, $field, $type, $message);
$this->_fields = $fields;
$this->_errorFields = array();
$this->_isLocaleField = $isLocaleField;
$this->_userFunction = $userFunction;
$this->_additionalArguments = $additionalArguments;
$this->_complementReturn = $complementReturn;
}
示例7: FormValidatorPost
/**
* Constructor.
* @param $form Form
* @param $message string the locale key to use (optional)
*/
function FormValidatorPost(&$form, $message = 'form.postRequired')
{
parent::FormValidator($form, 'dummy', FORM_VALIDATOR_REQUIRED_VALUE, $message);
}
示例8: FormValidatorRegExp
/**
* Constructor.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $type string the type of check, either "required" or "optional"
* @param $message string the error message for validation failures (i18n key)
* @param $regExp string the regular expression (PCRE form)
*/
function FormValidatorRegExp(&$form, $field, $type, $message, $regExp)
{
import('lib.pkp.classes.validation.ValidatorRegExp');
$validator = new ValidatorRegExp($regExp);
parent::FormValidator($form, $field, $type, $message, $validator);
}
示例9: FormValidatorCaptcha
/**
* Constructor.
* @param $form object
* @param $field string Name of captcha value submitted by user
* @param $captchaIdField string Name of captcha ID field
* @param $message string Key of message to display on mismatch
*/
function FormValidatorCaptcha(&$form, $field, $captchaIdField, $message)
{
parent::FormValidator($form, $field, FORM_VALIDATOR_REQUIRED_VALUE, $message);
$this->_captchaIdField = $captchaIdField;
}
示例10: FormValidatorRegExp
/**
* Constructor.
* @see FormValidator::FormValidator()
* @param $regExp string the regular expression (PCRE form)
*/
function FormValidatorRegExp(&$form, $field, $type, $message, $regExp)
{
parent::FormValidator($form, $field, $type, $message);
$this->regExp = $regExp;
}
示例11: FormValidatorLength
/**
* Constructor.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $type string the type of check, either "required" or "optional"
* @param $message string the error message for validation failures (i18n key)
* @param $comparator
* @param $length
*/
function FormValidatorLength(&$form, $field, $type, $message, $comparator, $length)
{
parent::FormValidator($form, $field, $type, $message);
$this->_comparator = $comparator;
$this->_length = $length;
}
示例12: FormValidatorBoolean
/**
* Constructor.
* @param $form Form the associated form
* @param $field string the name of the associated field
* @param $message string the error message for validation failures (i18n key)
*/
function FormValidatorBoolean(&$form, $field, $message)
{
parent::FormValidator($form, $field, FORM_VALIDATOR_OPTIONAL_VALUE, $message);
}
示例13: FormValidatorArray
/**
* Constructor.
* @see FormValidator::FormValidator()
* @param $field string field name specifying an array of fields, i.e. name[]
* @param $fields array all subfields for each item in the array, i.e. name[][foo]. If empty it is assumed that name[] is a data field
*/
function FormValidatorArray(&$form, $field, $type, $message, $fields = array())
{
parent::FormValidator($form, $field, $type, $message);
$this->fields = $fields;
$this->errorFields = array();
}
示例14: FormValidatorFileType
function FormValidatorFileType(&$form, $field, $type, $message)
{
parent::FormValidator($form, $field, $type, $message, $this);
}
示例15: FormValidatorPost
/**
* Constructor.
* @see FormValidator::FormValidator()
* @param message string the locale key to use (optional)
*/
function FormValidatorPost(&$form, $message = 'form.postRequired')
{
parent::FormValidator($form, 'dummy', 'required', $message);
}