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


PHP String::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($value, $varname = null)
 {
     $this->setLimit('6');
     $value = strtolower($value);
     $this->setRegexpMatch('/^([a-f]|[0-9]){6}$/');
     parent::__construct($value, $varname);
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:7,代码来源:Color.php

示例2: __construct

 public function __construct($value)
 {
     parent::__construct(strtoupper($value), 1);
     if (!preg_match('/^[A-Z0-9]$/', (string) $value)) {
         throw new InvalidFieldException('File Id Modifier "' . $value . '" must be A-Z 0-9.');
     }
 }
开发者ID:philipwhitt,项目名称:nacha-generator,代码行数:7,代码来源:FileIdModifier.php

示例3: __construct

 public function __construct($value)
 {
     $value = strtoupper($value);
     parent::__construct($value, 3);
     if (!in_array($value, $this->validClasses)) {
         throw new InvalidFieldException($value . ' is not a valid standard entry class.');
     }
 }
开发者ID:philipwhitt,项目名称:nacha-generator,代码行数:8,代码来源:StandardEntryClass.php

示例4: __construct

 /**
  * @param string $value
  * @param bool $visible
  */
 public function __construct($value, $visible = true)
 {
     if (false !== strpos($value, ';')) {
         throw new \InvalidArgumentException('Keyword should not contain semicolons');
     }
     parent::__construct($value);
     $this->visible = $visible;
 }
开发者ID:cultuurnet,项目名称:entry,代码行数:12,代码来源:Keyword.php

示例5: __construct

 public function __construct($value)
 {
     foreach ($this->triggers as $trigger) {
         if (stristr(strtolower($value), $trigger)) {
             $value = strtoupper($value);
         }
     }
     parent::__construct($value, 10);
 }
开发者ID:kulparoman,项目名称:nacha-generator,代码行数:9,代码来源:CompanyEntryDescription.php

示例6: __construct

 /**
  * @param $filePath string Name of the conf file (or full path).
  * @throws Exception
  */
 public function __construct($filePath)
 {
     $this->inFilePath = $filePath;
     $contents = @file_get_contents($this->inFilePath);
     if (false === $contents) {
         throw new Exception('Cannot read file "' . $this->inFilePath . '".');
     }
     parent::__construct($contents);
 }
开发者ID:harshadyeola,项目名称:Nginx-Config-Processor,代码行数:13,代码来源:File.php

示例7: __construct

 public function __construct($string)
 {
     parent::__construct($string);
     if ($this->getStringLength() >= 1) {
         $this->pass = $string;
     } else {
         throw new \InvalidArgumentException('Password too short');
     }
 }
开发者ID:Rayac,项目名称:PDOtest,代码行数:9,代码来源:Pass.php

示例8: __construct

 public function __construct($label, $flags, $timePrecision = null, $timerFormat = null, $val = null, $filterCriteria = null)
 {
     $this->timerFormat = $timerFormat;
     if (isset($timePrecision)) {
         $this->timePrecision = $timePrecision;
     } else {
         $this->timePrecision = 'seconds';
     }
     parent::__construct($label, $flags, $val, $filterCriteria);
 }
开发者ID:simplonphp,项目名称:simplonphp,代码行数:10,代码来源:TimeTo.php

示例9: __construct

 public function __construct($string, $returnMode = 'default')
 {
     if (!extension_loaded('mbstring')) {
         $err = "This class required mbstring extension to be loaded.\r\n\t\t\t\nPlease check you php to make sure you have mbstring extension";
         e($err);
         throw new \RuntimeException($err);
     }
     parent::__construct($string, $returnMode);
     mb_regex_encoding("UTF-8");
     mb_internal_encoding("UTF-8");
     /**
      * @todo if have iconv, also set its' encoding to utf-8
      */
 }
开发者ID:netconstructor,项目名称:LampCMS,代码行数:14,代码来源:Utf8String.php

示例10: __construct

 /**
  * function __contruct get the parameters to them in the parent construct
  * 
  * @param string $label
  * @param array $options
  * @param string $flags
  * @param string $val
  * @param string $filterCriteria
  */
 public function __construct($label = null, $options = array(), $flags = null, $val = null, $filterCriteria = null)
 {
     $this->options = $options;
     parent::__construct($label, $flags, $val, $filterCriteria);
     //echo $this->showInput(true);
 }
开发者ID:simplonphp,项目名称:simplonphp,代码行数:15,代码来源:RadioButtonText.php

示例11: __construct

 public function __construct($value)
 {
     $value = strtolower($value) == 'check destroyed' ? strtoupper($value) : $value;
     parent::__construct($value, 16);
 }
开发者ID:kulparoman,项目名称:nacha-generator,代码行数:5,代码来源:CompanyName.php

示例12: __construct

 /**
  * @param $value string
  * @param $type string the type of the displayable object : class, method, property or string
  */
 public function __construct($value, $type)
 {
     parent::__construct($value);
     $this->type = $type;
 }
开发者ID:TuxBoy,项目名称:Demo-saf,代码行数:9,代码来源:Displayable.php

示例13: __construct

 /**
  * @param string $url
  * @param string $contents
  * @param string $encoding
  **/
 public function __construct($url, $contents, $encoding = "utf-8")
 {
     $this->url = $url;
     parent::__construct($contents, $encoding);
 }
开发者ID:ju1ius,项目名称:libphp,代码行数:10,代码来源:File.php

示例14: __construct

 /**
  * Sets a character limit and makes sure the value is a valid email address.
  * @param string $varname Name of variable
  * @param string $value Email address
  */
 public function __construct($value = null, $varname = null)
 {
     $this->setLimit('80');
     $this->setRegexpMatch('/^[\\w.%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$/i');
     parent::__construct($value, $varname);
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:11,代码来源:Email.php

示例15: __construct

 /**
  * Checks the value to ensure it is a proper url.
  * The construct will throw an exception if the string does not pass.
  * @param string $varname
  * @param string $value
  */
 public function __construct($value = null, $varname = null)
 {
     $this->setRegexpMatch('/^(https?:\\/\\/|\\.\\/|\\/\\/)?\\w([,\\.\\w\\-\\/&;?\\+=~#])+$/i');
     parent::__construct($value, $varname);
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:11,代码来源:Url.php


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