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