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