本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
$this->setParameter('slug_error', 'Slug already exists');
$this->getParameterHolder()->add($parameters);
return true;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}