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


PHP Input::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * @param string $name
  * @param AbstractResourceFactory $resourceFactory
  * @param \Doctrine\ORM\EntityManager $entityManager
  * @param \Zf2FileUploader\Options\ImageResourceOptionsInterface $imageOptions
  */
 public function __construct($name = 'image', AbstractResourceFactory $resourceFactory, EntityManager $entityManager, ImageResourceOptionsInterface $imageOptions)
 {
     parent::__construct($name);
     $this->abstractResourceFactory = $resourceFactory;
     $validator = new ResourceTokenValidator($entityManager->getRepository($imageOptions->getImageEntityClass()));
     $this->getValidatorChain()->attach($validator);
 }
開發者ID:spalax,項目名稱:zf2-file-uploader,代碼行數:13,代碼來源:FromList.php

示例2: __construct

 public function __construct($name = '')
 {
     parent::__construct($name);
     if ($this->isRequired()) {
         /** @var $notEmpty \Zend\Validator\NotEmpty */
         $notEmpty = $this->getValidatorChain()->plugin('NotEmpty', array());
         $notEmpty->setMessages(array(Validator\NotEmpty::INVALID => 'Неверный тип значения. Ожидается строка, массив или тип boolean.', Validator\NotEmpty::IS_EMPTY => 'Значение обязательное и не может быть пустым'));
         $this->getValidatorChain()->prependValidator($notEmpty, true);
     }
 }
開發者ID:t4web,項目名稱:base,代碼行數:10,代碼來源:Element.php

示例3: __construct

 /**
  * AbstractFilter constructor.
  * @param null $strName
  * @param array $arrToHaystack
  * @param bool $booRequired
  * @param bool $booSetDefaultValidators
  * @param int $intMinLength
  * @param int $intMaxLength
  */
 public function __construct($strName, array $arrToHaystack = array(), $booRequired = true, $booSetDefaultValidators = true, $intMinLength = 0, $intMaxLength = 0)
 {
     parent::__construct($strName);
     if (count($arrToHaystack)) {
         $this->getValidatorChain()->attach($this->getHaystackValidator($arrToHaystack));
     }
     if ($booRequired) {
         $this->setRequired($booRequired);
     }
     if ($booSetDefaultValidators) {
         $this->getFilterChain()->attach(new StripTags())->attach(new StringTrim());
     }
     $this->setMinAndMaxStringLengthValidator($intMinLength, $intMaxLength);
 }
開發者ID:diego-mi,項目名稱:financeiro,代碼行數:23,代碼來源:BaseInputFilter.php

示例4: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->getFilterChain()->attachByName('StringTrim');
     $this->getValidatorChain()->attachByName('Digits')->attachByName('GreaterThan', ['min' => 0]);
 }
開發者ID:t4web,項目名稱:crud,代碼行數:6,代碼來源:Id.php

示例5: __construct

 /**
  * @param string $name
  * @param AbstractResourceFactory $resourceFactory
  */
 public function __construct($name = 'content', AbstractResourceFactory $resourceFactory)
 {
     $this->abstractResourceFactory = $resourceFactory;
     $this->scanner = new Scanner(ImageResource::UNIQUE_RESOURCE_PREFIX);
     parent::__construct($name);
 }
開發者ID:spalax,項目名稱:zf2-file-uploader,代碼行數:10,代碼來源:FromText.php

示例6: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->getFilterChain()->attach(new GeolocationFilter());
 }
開發者ID:baptistecosta,項目名稱:mon-partenaire,代碼行數:5,代碼來源:Geolocation.php


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