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


PHP Input::setValidatorChain方法代码示例

本文整理汇总了PHP中Zend\InputFilter\Input::setValidatorChain方法的典型用法代码示例。如果您正苦于以下问题:PHP Input::setValidatorChain方法的具体用法?PHP Input::setValidatorChain怎么用?PHP Input::setValidatorChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\InputFilter\Input的用法示例。


在下文中一共展示了Input::setValidatorChain方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCanInjectValidatorChain

 public function testCanInjectValidatorChain()
 {
     $input = new Input('foo');
     $chain = new Validator\ValidatorChain();
     $input->setValidatorChain($chain);
     $this->assertSame($chain, $input->getValidatorChain());
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:7,代码来源:InputTest.php

示例2: createInputFilter

 public function createInputFilter()
 {
     $inputFilter = new InputFilter\InputFilter();
     $email = new InputFilter\Input('email');
     $email->setRequired(true);
     $validatorChain = new Validator\ValidatorChain();
     $validatorChain->attach(new Validator\EmailAddress());
     $email->setValidatorChain($validatorChain);
     $inputFilter->add($email);
     return $inputFilter;
 }
开发者ID:papertask,项目名称:papertask,代码行数:11,代码来源:ForgotPasswordForm.php

示例3: createInputFilter

 public function createInputFilter()
 {
     $inputFilter = new InputFilter\InputFilter();
     //username
     $username = new InputFilter\Input('email');
     $username->setRequired(true);
     $validatorChain = new Validator\ValidatorChain();
     $validatorChain->attach(new Validator\EmailAddress());
     $username->setValidatorChain($validatorChain);
     $inputFilter->add($username);
     //password
     $password = new InputFilter\Input('password');
     $password->setRequired(true);
     $inputFilter->add($password);
     return $inputFilter;
 }
开发者ID:papertask,项目名称:papertask,代码行数:16,代码来源:LoginForm.php

示例4: createInputFilter

 protected function createInputFilter()
 {
     $inputFilter = new InputFilter\InputFilter();
     // password
     $password = new InputFilter\Input('password');
     $password->setRequired(true);
     // Generate password validator chain
     $validatorPasswordChain = new Validator\ValidatorChain();
     $validatorPasswordChain->attach(new Validator\StringLength(array('min' => 6)));
     $password->setValidatorChain($validatorPasswordChain);
     $inputFilter->add($password);
     // confirmation
     $confirmation = new InputFilter\Input('confirmation');
     $confirmation->setRequired(true);
     $confirmation->setValidatorChain($validatorPasswordChain);
     $inputFilter->add($confirmation);
     return $inputFilter;
 }
开发者ID:papertask,项目名称:papertask,代码行数:18,代码来源:ResetForm.php

示例5: __construct

 public function __construct()
 {
     $title = new Input('title');
     $title->setRequired(true);
     $title->setValidatorChain($this->getTitleValidatorChain());
     $title->setFilterChain($this->getStringTrimFilterChain());
     $slug = new Input('slug');
     $slug->setRequired(true);
     $slug->setValidatorChain($this->getSlugValidatorChain());
     $slug->setFilterChain($this->getStringTrimFilterChain());
     $content = new Input('content');
     $content->setRequired(true);
     $content->setValidatorChain($this->getContentValidatorChain());
     $content->setFilterChain($this->getStringTrimFilterChain());
     $this->add($title);
     $this->add($slug);
     $this->add($content);
 }
开发者ID:samija,项目名称:Deeplifec4tk,代码行数:18,代码来源:AddPost.php

示例6: createInputFilter

 protected function createInputFilter()
 {
     $inputFilter = new InputFilter\InputFilter();
     //type
     $type = new InputFilter\Input('type');
     $type->setRequired(true);
     $inputFilter->add($type);
     //subject
     $subject = new InputFilter\Input('subject');
     $subject->setRequired(true);
     $inputFilter->add($subject);
     //content
     $content = new InputFilter\Input('content');
     $content->setRequired(true);
     $inputFilter->add($content);
     //language
     $language = new InputFilter\Input('content');
     $language->setRequired(true);
     $validatorChain = new Validator\ValidatorChain();
     $validatorChain->attach(new Validator\Between(array('min' => 0, 'max' => 1)));
     $language->setValidatorChain($validatorChain);
     $inputFilter->add($language);
     return $inputFilter;
 }
开发者ID:papertask,项目名称:papertask,代码行数:24,代码来源:EmailTemplateForm.php


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