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


PHP Text::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($name = null, $options = array())
 {
     if (is_string($options)) {
         $options = array('whitelist' => $options);
     }
     return parent::__construct($name, $options);
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:7,代码来源:HTMLText.php

示例2: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->addTest('numeric', function ($value) {
         return preg_replace('/[^\\d]/', '', $value) == $value;
     });
 }
开发者ID:monomelodies,项目名称:formulaic,代码行数:7,代码来源:Tel.php

示例3: __construct

 /**
  * @param bool $name
  * @param string $label
  * @param string $desc
  * @param bool $required
  * @param int $width
  * @param string $default
  * @param int $height
  * @param int $rows
  * @param int $cols
  * @param int $lengthMax
  * @param int $lengthMin
  */
 public function __construct($label = null, $name = null, $desc = null, $required = false, $width = 280, $default = '', $height = 100, $rows = 4, $cols = 30, $lengthMax = false, $lengthMin = false)
 {
     parent::__construct($label, $name, $desc, $required, $width, $default, $lengthMax, $lengthMin);
     $this->_height = intval($height);
     $this->_rows = $rows;
     $this->_cols = $cols;
 }
开发者ID:tashik,项目名称:phalcon_core,代码行数:20,代码来源:TextArea.php

示例4: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->addTest('valid', function ($value) {
         return strtotime($value);
     });
 }
开发者ID:monomelodies,项目名称:formulaic,代码行数:7,代码来源:Datetime.php

示例5: __construct

 /**
  * __construct
  *
  * @param string  $caption caption
  * @param string  $name    name
  * @param integer $size    field size
  * @param integer $value   date as unix timestamp
  */
 public function __construct($caption, $name, $size = 2, $value = 0)
 {
     if ($value !== '') {
         $value = $value === 0 ? time() : (int) $value;
     }
     parent::__construct($caption, $name, $size, 2, $value);
 }
开发者ID:redmexico,项目名称:XoopsCore,代码行数:15,代码来源:DateSelect.php

示例6: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->addTest('valid', function ($value) {
         return filter_var($value, FILTER_VALIDATE_EMAIL) && preg_match("/.*@.*\\..*/", $value);
     });
 }
开发者ID:monomelodies,项目名称:formulaic,代码行数:7,代码来源:Email.php

示例7: __construct

 /**
  * Overload the constdcteur
  *
  * BooleanSwitch constructor.
  * @param $name
  * @param string $label
  * @param null $function
  */
 public function __construct($name, $label = '', $function = null)
 {
     parent::__construct($name, $label);
     if (!is_null($function)) {
         $this->setRemoteProcess($function);
     }
 }
开发者ID:frenchfrogs,项目名称:framework,代码行数:15,代码来源:RemoteText.php

示例8: __construct

 /**
  * Create instance
  *
  * @param string $name The name of the field
  * @param array  $data The data to construct the field
  */
 public function __construct($name, array $data)
 {
     parent::__construct($name, $data);
     if (array_key_exists('placeholder', $data)) {
         $this->placeholder = $data['placeholder'];
     }
     $this->type = 'password';
 }
开发者ID:peehaa,项目名称:pitchblade,代码行数:14,代码来源:Password.php

示例9: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->attributes['placeholder'] = 'http://';
     $this->addTest('url', function ($value) {
         return filter_var($value, FILTER_VALIDATE_URL);
     });
 }
开发者ID:monomelodies,项目名称:formulaic,代码行数:8,代码来源:Url.php

示例10: __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:SYpanel,项目名称:SYpanel,代码行数:13,代码来源:File.php

示例11: __construct

 /**
  * Constructror
  *
  * @param $name
  * @param string $label
  * @param array $attr
  */
 public function __construct($name, $label = '', $format = null, $attr = [])
 {
     parent::__construct($name, $label, $attr);
     $this->center();
     if (is_null($format)) {
         $format = configurator()->get('table.column.date.format');
     }
     $this->addFilter('dateFormat', 'dateFormat', $format);
 }
开发者ID:frenchfrogs,项目名称:framework,代码行数:16,代码来源:Date.php

示例12: __construct

 public function __construct($label, $attributes)
 {
     parent::__construct($label, $attributes);
     if (!isset($attributes['rows'])) {
         $attributes['rows'] = 6;
     }
     if (!isset($attributes['cols'])) {
         $attributes['cols'] = 60;
     }
 }
开发者ID:birah,项目名称:Nibble-Forms,代码行数:10,代码来源:TextArea.php

示例13: __construct

 /**
  * __construct
  *
  * @param string|array      $caption caption or array of all attributes
  * @param string            $name    name
  * @param integer|\DateTime $value   unix timestamp or DateTime object
  */
 public function __construct($caption, $name = null, $value = null)
 {
     if (is_array($caption)) {
         parent::__construct($caption);
         $this->setIfNotSet('size', 15);
         $this->setIfNotSet('value', 0);
         $this->set('value', \Xoops\Core\Locale\Time::cleanTime($this->get('value', null)));
     } else {
         parent::__construct([]);
         $this->setCaption($caption);
         $this->setName($name);
         $this->set('size', 15);
         $this->setValue(\Xoops\Core\Locale\Time::cleanTime($value));
     }
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:22,代码来源:DateSelect.php

示例14: __construct

 /**
  * __construct
  *
  * @param string|array $caption field caption or array of all attributes
  * @param string       $name    field name
  * @param string       $value   field value
  */
 public function __construct($caption, $name = null, $value = '#FFFFFF')
 {
     if (is_array($caption)) {
         parent::__construct($caption);
         $value = $this->get('value', '');
         if (empty($value)) {
             $this->set('value', '#FFFFFF');
         }
         $this->setIfNotSet('size', 10);
         $this->setIfNotSet('maxlength', 16);
     } else {
         parent::__construct([]);
         $this->set('caption', $caption);
         $this->setWithDefaults('name', $name, 'name_error');
         $this->set('size', 10);
         $this->set('maxlength', 16);
         $this->set('value', $value);
     }
     $this->setIfNotSet('type', 'text');
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:27,代码来源:ColorPicker.php

示例15: __construct

 /**
  * Constructor
  *
  * Instantiate the captcha input form element
  *
  * @param  string $name
  * @param  string $value
  * @param  string $indent
  * @param  int    $expire
  * @param  string $captcha
  * @return Captcha
  */
 public function __construct($name, $value = null, $indent = null, $expire = 300, $captcha = null)
 {
     // Start a session.
     if (session_id() == '') {
         session_start();
     }
     // If token does not exist, create one
     if (!isset($_SESSION['pop_captcha'])) {
         if (null === $captcha) {
             $captcha = $this->generateEquation();
         } else {
             if (stripos($captcha, '<img') === false) {
                 $captcha = strtoupper($captcha);
             }
         }
         $this->token = ['captcha' => $captcha, 'value' => null, 'expire' => (int) $expire, 'start' => time()];
         $_SESSION['pop_captcha'] = serialize($this->token);
         // Else, retrieve existing token
     } else {
         $this->token = unserialize($_SESSION['pop_captcha']);
         // Check to see if the token has expired
         if ($this->token['expire'] > 0) {
             if ($this->token['expire'] + $this->token['start'] < time()) {
                 if (null === $captcha) {
                     $captcha = $this->generateEquation();
                 } else {
                     if (stripos($captcha, '<img') === false) {
                         $captcha = strtoupper($captcha);
                     }
                 }
                 $this->token = ['captcha' => $captcha, 'value' => null, 'expire' => (int) $expire, 'start' => time()];
                 $_SESSION['pop_captcha'] = serialize($this->token);
             }
         }
     }
     parent::__construct($name, strtoupper($value), $indent);
     $this->setRequired(true);
     $this->setValidator();
 }
开发者ID:Nnadozieomeonu,项目名称:lacecart,代码行数:51,代码来源:Captcha.php


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