當前位置: 首頁>>代碼示例>>PHP>>正文


PHP InputFilter::add方法代碼示例

本文整理匯總了PHP中InputFilter::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP InputFilter::add方法的具體用法?PHP InputFilter::add怎麽用?PHP InputFilter::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在InputFilter的用法示例。


在下文中一共展示了InputFilter::add方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getInputFilter

 public function getInputFilter()
 {
     if (!$this->inputFilter) {
         $inputFilter = new InputFilter();
         $inputFilter->add(array('name' => 'id', 'required' => 'true', 'filters' => array(array('name' => 'Int'))));
         $inputFilter->add(array('name' => 'jenis', 'required' => 'true', 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100)))));
         $inputFilter->add(array('name' => 'inmission', 'required' => 'true'));
     }
     return $inputFilter;
 }
開發者ID:ibnuda,項目名稱:SayaSakit,代碼行數:10,代碼來源:Senjata.php

示例2: getInputFilter

 public function getInputFilter()
 {
     if (!$this->inputFilter) {
         $inputFilter = new InputFilter();
         $factory = new InputFactory();
         $inputFilter->add($factory->createInput(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100))))));
         $inputFilter->add($factory->createInput(array('name' => 'password', 'required' => true)));
         $this->inputFilter = $inputFilter;
     }
     return $this->inputFilter;
 }
開發者ID:bladehr8,項目名稱:bowhunter2015,代碼行數:11,代碼來源:Player.php

示例3: getInputFilter

 public function getInputFilter($data)
 {
     $inputFilter = new InputFilter();
     $factory = new InputFactory();
     $inputFilter->add($factory->createInput(array('name' => 'id', 'required' => false)));
     $validator = new \DoctrineModule\Validator\NoObjectExists(array('object_repository' => $this->objectManager->getRepository($this->entityName), 'fields' => array('fullname')));
     //use in check email exist when sign up
     $filter = $validator->isValid(array('fullname' => $data['fullName']));
     // dumps 'true' if an entity matches
     return $filter;
 }
開發者ID:binnguyen,項目名稱:kaffacoffee,代碼行數:11,代碼來源:userModel.php

示例4: getInputFilter

 public function getInputFilter()
 {
     if (!$this->inputFilter) {
         $inputFilter = new InputFilter();
         $factory = new InputFactory();
         $inputFilter->add($factory->createInput(array('name' => 'id', 'required' => false, 'filters' => array(array('name' => 'Int')))));
         $inputFilter->add($factory->createInput(array('name' => 'rating', 'required' => false, 'filters' => array(array('name' => 'Int')))));
         $inputFilter->add($factory->createInput(array('name' => 'name', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100))))));
         $inputFilter->add($factory->createInput(array('name' => 'alias', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100))))));
         /*
         $inputFilter->add ( $factory->createInput ( array (
         		'name' => 'availability',
         		'required' => true,
         		'filters' => array (
         				array (
         						'name' => 'Int'
         				)
         		)
         ) ) );
         
         
         
         $inputFilter->add ( $factory->createInput ( array (
         		'name' => 'description',
         		'required' => false,
         		'filters' => array (
         				array (
         						'name' => 'StripTags'
         				),
         				array (
         						'name' => 'StringTrim'
         				)
         		),
         		'validators' => array (
         				array (
         						'name' => 'StringLength',
         						'options' => array (
         								'encoding' => 'UTF-8',
         								'min' => 1,
         								'max' => 100
         						)
         				)
         		)
         ) ) );
         
         
         $inputFilter->add ( $factory->createInput ( array (
         		'name' => 'detail_product',
         		'required' => false,
         		'filters' => array (
         				array (
         						'name' => 'StripTags'
         				),
         				array (
         						'name' => 'StringTrim'
         				)
         		),
         		'validators' => array (
         				array (
         						'name' => 'StringLength',
         						'options' => array (
         								'encoding' => 'UTF-8',
         								'min' => 1,
         								'max' => 100
         						)
         				)
         		)
         ) ) );
         
         $inputFilter->add ( $factory->createInput ( array (
         		'name' => 'promotions',
         		'required' => false,
         		'filters' => array (
         				array (
         						'name' => 'Int'
         				)
         		)
         ) ) );
         
         $inputFilter->add ( $factory->createInput ( array (
         		'name' => 'about_price',
         		'required' => false,
         		'filters' => array (
         				array (
         						'name' => 'Int'
         				)
         		)
         ) ) );
         
         $inputFilter->add ( $factory->createInput ( array (
         		'name' => 'new',
         		'required' => false,
         		'filters' => array (
         				array (
         						'name' => 'Int'
         				)
         		)
         ) ) );
         
         $inputFilter->add ( $factory->createInput ( array (
//.........這裏部分代碼省略.........
開發者ID:gstearmit,項目名稱:EshopVegeTable,代碼行數:101,代碼來源:Lazada.php


注:本文中的InputFilter::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。