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


PHP Input::setName方法代码示例

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


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

示例1: getInputFilter

 public function getInputFilter()
 {
     if (!$this->inputFilter) {
         $input = new Input();
         $input->setName('entities');
         $input->setRequired(false);
         $this->inputFilter = new RealInputFilter();
         $this->inputFilter->add($input);
     }
     return $this->inputFilter;
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:11,代码来源:HydratorStrategyEntityA.php

示例2: getInputFilter

 public function getInputFilter()
 {
     $inputFilter = new InputFilter();
     $username = new Input();
     $username->setName('username')->setRequired(true);
     $username->setErrorMessage('A Username is required to Login');
     $inputFilter->add($username);
     $password = new Input();
     $password->setName('password')->setRequired(true);
     $password->setErrorMessage('A Password is required to Login');
     $inputFilter->add($password);
     return $inputFilter;
 }
开发者ID:notquitehere,项目名称:gibson,代码行数:13,代码来源:Login.php

示例3: createService

 /**
  * @param ServiceLocatorInterface $serviceLocator
  *
  * @return InputFilter
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $username = new Input();
     $username->setName('username');
     $username->setRequired(true);
     $username->setAllowEmpty(false);
     $username->getFilterChain()->attach(new StringTrim())->attach(new StripTags());
     $password = new Input();
     $password->setName('password');
     $password->setRequired(true);
     $password->setAllowEmpty(false);
     $password->getFilterChain()->attach(new StringTrim())->attach(new StripTags());
     $password->getValidatorChain()->attach($serviceLocator->get('UghAuthentication\\Authentication\\Validator\\Authentication'));
     $inputFilter = new InputFilter();
     $inputFilter->add($username);
     $inputFilter->add($password);
     return $inputFilter;
 }
开发者ID:ughly,项目名称:ugh-authentication,代码行数:23,代码来源:LoginFactory.php

示例4: setControlName

 /**
  * Manually override the default control name for this field.
  *
  * This can be useful and necessary if you are using multiple instances of
  * the same model and field on a single page and you need to disambiguate
  * them.
  *
  * @param string $controlName
  * @return \Dewdrop\Db\Field
  */
 public function setControlName($controlName)
 {
     $this->controlName = $controlName;
     if ($this->inputFilter) {
         $this->inputFilter->setName($this->controlName);
     }
     return $this;
 }
开发者ID:bravadomizzou,项目名称:dewdrop,代码行数:18,代码来源:Field.php

示例5: testInputFilterValidates

 public function testInputFilterValidates()
 {
     $baddata = '1234';
     $gooddata = '12345';
     $tableName = 'sometable';
     $service = new AggregateEntityFilterService();
     $service->setBaseTable($tableName);
     $entityFilter = new BaseEntityFilterService();
     $entityFilter->setTableName($tableName);
     $input = new Input();
     $input->setName('name')->setAllowEmpty(FALSE)->getValidatorChain()->attach(new StringLength(5));
     $inputFilter = new InputFilter();
     $inputFilter->add($input);
     $entityFilter->setInputFilter($inputFilter);
     $entityFilter->setData(array('name' => $baddata));
     $service->add($entityFilter);
     $this->assertFalse($service->isValid(), 'Should have failed filter input validator');
     $service = new AggregateEntityFilterService();
     $service->setBaseTable($tableName);
     $entityFilter->setData(array('name' => $gooddata));
     $service->add($entityFilter);
     $this->assertTrue($service->isValid(), 'Should have passed filter input validator');
 }
开发者ID:nobesnickr,项目名称:ApiTimesheets,代码行数:23,代码来源:AggregateEntityFilterServiceTest.php


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