当前位置: 首页>>代码示例>>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;未经允许,请勿转载。