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


PHP sfValidator类代码示例

本文整理汇总了PHP中sfValidator的典型用法代码示例。如果您正苦于以下问题:PHP sfValidator类的具体用法?PHP sfValidator怎么用?PHP sfValidator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了sfValidator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

 /**
  * 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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