本文整理汇总了PHP中sfValidator类的典型用法代码示例。如果您正苦于以下问题:PHP sfValidator类的具体用法?PHP sfValidator怎么用?PHP sfValidator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sfValidator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Initializes this validator.
*
* @param sfContext The current application context
* @param array An associative array of initialization parameters
*
* @return boolean true, if initialization completes successfully, otherwise false
*/
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('callback', null);
$this->getParameterHolder()->set('invalid_error', 'Invalid input');
$this->getParameterHolder()->add($parameters);
// check parameters
if (!is_callable($this->getParameterHolder()->get('callback'))) {
// no pattern specified
throw new sfValidatorException('Callback function must be a valid callback using is_callable().');
}
return true;
}
开发者ID:WIZARDISHUNGRY,项目名称:symfony,代码行数:23,代码来源:sfCallbackValidator.class.php
示例2: initialize
/**
* Initializes this validator.
*
* @param sfContext The current application context
* @param array An associative array of initialization parameters
*
* @return bool true, if initialization completes successfully, otherwise false
*/
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('match', true);
$this->getParameterHolder()->set('match_error', 'Invalid input');
$this->getParameterHolder()->set('pattern', null);
$this->getParameterHolder()->add($parameters);
// check parameters
if ($this->getParameterHolder()->get('pattern') == null) {
// no pattern specified
throw new sfValidatorException('Please specify a PCRE regular expression pattern for your registered RegexValidator.');
}
return true;
}
开发者ID:JimmyVB,项目名称:Symfony-v1.2,代码行数:24,代码来源:sfRegexValidator.class.php
示例3: initialize
/**
* Initialize this validator.
*
* @param sfContext The current application context.
* @param array An associative array of initialization parameters.
*
* @return bool true, if initialization completes successfully, otherwise false.
*/
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->setParameter('unique_error', 'Uniqueness error');
$this->getParameterHolder()->add($parameters);
// check parameters
if (!$this->getParameter('class')) {
throw new sfValidatorException('The "class" parameter is mandatory for the sfDoctrineUniqueValidator validator.');
}
if (!$this->getParameter('column')) {
throw new sfValidatorException('The "column" parameter is mandatory for the sfDoctrineUniqueValidator validator.');
}
return true;
}
开发者ID:JimmyVB,项目名称:Symfony-v1.2,代码行数:24,代码来源:sfDoctrineUniqueValidator.class.php
示例4: initialize
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
//Set default parameters value
$this->setParameter('custom_unique_error', 'The value is not unique');
$this->getParameterHolder()->add($parameters);
// check parameters
if (!$this->getParameter('class')) {
throw new sfValidatorException('The "class" parameter is mandatory for the sfCustomUniqueValidator validator.');
}
if (!$this->getParameter('nb_fields')) {
throw new sfValidatorException('The "nb_fields" parameter is mandatory for the sfCustomUniqueValidator validator.');
}
return true;
}
开发者ID:mediasadc,项目名称:alba,代码行数:16,代码来源:sfCustomUniqueValidator.php
示例5: initialize
/**
* Initialize this validator.
*
* @param sfContext The current application context.
* @param array An associative array of initialization parameters.
*
* @return bool true, if initialization completes successfully, otherwise false.
*/
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:15,代码来源:myChoiceValidator.class.php
示例6: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
$this->setParameter('msg', 'You\'ve already registered your blog.');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:noose,项目名称:Planeta,代码行数:7,代码来源:myOneBlogPerAccountValidator.php
示例7: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
$this->setParameter('slug_error', 'Slug already exists');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:soon0009,项目名称:EMS,代码行数:7,代码来源:mySlugValidator.class.php
示例8: initialize
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
$this->getParameterHolder()->set('code_error', 'wrong code');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:sgrove,项目名称:cothinker,代码行数:8,代码来源:sfCryptographpValidator.class.php
示例9: initialize
function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('cuit_error', 'CUIT Invalido');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:mediasadc,项目名称:alba,代码行数:9,代码来源:albaCUITValidator.class.php
示例10: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
$this->setParameter('password', 'password');
$this->setParameter('login_error', 'Login error');
$this->setParameter('unknown_error', 'Unknown error');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:noose,项目名称:Planeta,代码行数:9,代码来源:myLoginValidator.class.php
示例11: initialize
/**
* Initialize this validator.
*
* @param sfContext The current application context.
* @param array An associative array of initialization parameters.
*
* @return bool true, if initialization completes successfully, otherwise false.
*/
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->setParameter('unique_error', 'Uniqueness error');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:17,代码来源:myPropelUniqueSchemaUriValidator.class.php
示例12: initialize
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('expect', self::VALID);
$this->getParameterHolder()->set('error_msg', "address seems to have an error");
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:10,代码来源:sfMobileEmailValidator.class.php
示例13: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
// Set defaults
$this->getParameterHolder()->set('username_error', 'Username or password is not valid.');
$this->getParameterHolder()->set('password_field', 'password');
$this->getParameterHolder()->set('remember_field', 'remember');
$this->getParameterHolder()->set('activation', 'You cannot log in until you have activated your user, you should have received an email with a activation link.');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:kjbekkelund,项目名称:avrphpbbplugin,代码行数:11,代码来源:avrPhpbbAuthValidator.class.php
示例14: initialize
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('twitter_error', 'Twitter username or password is not valid.');
$this->getParameterHolder()->set('password_field', 'twitter_password');
$this->getParameterHolder()->set('update_field', 'twitter_update');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:sgrove,项目名称:cothinker,代码行数:11,代码来源:twitterAccountValidator.class.php
示例15: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
$this->setParameter('password', 'password');
$this->setParameter('login_error', 'Invalid input');
$this->setParameter('password_error', 'Invalid input');
$this->setParameter('inactive_error', 'Your forum account is inactive.');
$this->setParameter('unknown_error', 'Unknown error');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:noose,项目名称:Planeta,代码行数:11,代码来源:myVerificationValidator.php
示例16: initialize
/**
* Initializes this validator.
*
* @param sfContext The current application context
* @param array An associative array of initialization parameters
*
* @return bool true, if initialization completes successfully, otherwise false
*/
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('strict', true);
$this->getParameterHolder()->set('check_domain', false);
$this->getParameterHolder()->set('email_error', 'Invalid input');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:taryono,项目名称:school,代码行数:19,代码来源:sfEmailValidator.class.php
示例17: initialize
public function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('username_error', null);
$this->getParameterHolder()->set('password_field', 'password');
$this->getParameterHolder()->set('remember_field', 'remember');
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:stereoscott,项目名称:stKerberosPlugin,代码行数:11,代码来源:stKerberosValidator.php
示例18: initialize
function initialize($context, $parameters = null)
{
// initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('documento_error', 'Documento Invalido');
$this->getParameterHolder()->set('nombre_campo1', null);
$this->getParameterHolder()->set('nombre_campo2', null);
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:mediasadc,项目名称:alba,代码行数:11,代码来源:albaDocumentoValidator.class.php
示例19: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
$user = $context->getUser();
$id = $context->getRequest()->getParameter('id');
$lang = $context->getRequest()->getParameter('lang');
$document = Document::find('Image', $id);
$type = $document->get('image_type');
$this->setParameter('is_moderator', $user->hasCredential('moderator'));
$this->setParameter('was', $type);
$this->getParameterHolder()->add($parameters);
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:12,代码来源:myImageTypeValidator.class.php
示例20: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
// Initialize parent
parent::initialize($context);
// set defaults
$this->getParameterHolder()->set('required', true);
$this->getParameterHolder()->set('error', 'You must select at least one activity');
// Set parameters
$this->getParameterHolder()->add($parameters);
return true;
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:12,代码来源:myActivitiesValidator.class.php
注:本文中的sfValidator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论