本文整理汇总了PHP中sfValidator::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP sfValidator::initialize方法的具体用法?PHP sfValidator::initialize怎么用?PHP sfValidator::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfValidator
的用法示例。
在下文中一共展示了sfValidator::initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: initialize
public function initialize($context, $parameters = null)
{
parent::initialize($context);
$this->setParameter('slug_error', 'Slug already exists');
$this->getParameterHolder()->add($parameters);
return true;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: 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;
}
示例14: 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;
}
示例15: 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);
}