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