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


PHP Input::__construct方法代碼示例

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


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

示例1: __construct

 public function __construct($opts, $form = null)
 {
     parent::__construct($opts, $form);
     $cur_year = date('Y');
     // months
     if (!isset($this->months)) {
         //$this->months[0] = $this->placeholder['month'];
         foreach (range(1, 12) as $m) {
             $this->months[$m] = date($this->month_format, strtotime($cur_year . '-' . $m . '-1'));
         }
     }
     // days
     // $this->days = array_merge([$this->placeholder['day']], range(1,31));
     $this->days = range(1, 31);
     // years
     if (!isset($this->years)) {
         $this->min_year = isset($this->min_year) ? $this->min_year : $cur_year - 100;
         $this->max_year = isset($this->max_year) ? $this->max_year : $cur_year;
         foreach (range($this->min_year, $this->max_year) as $y) {
             $this->years[$y] = $y;
         }
         if ($this->year_order == 'DESC') {
             $this->years = array_reverse($this->years, true);
         }
     }
     return $this;
 }
開發者ID:aronduby,項目名稱:form,代碼行數:27,代碼來源:DateSelect.php

示例2: __construct

 public function __construct($sender, $recipient, $messageID, $createdDate, $mediaID, $thumbnailMediaID, $shortVideo = false)
 {
     parent::__construct($sender, $recipient, $messageID, $createdDate);
     $this->sight = $shortVideo;
     $this->mediaID = $mediaID;
     $this->thumbnailMediaID = $thumbnailMediaID;
 }
開發者ID:garbetjie,項目名稱:wechat,代碼行數:7,代碼來源:Video.php

示例3: __construct

 public function __construct($sender, $recipient, $messageID, $createdDate, $url, $title, $description)
 {
     parent::__construct($sender, $recipient, $messageID, $createdDate);
     $this->url = $url;
     $this->title = $title;
     $this->description = $description;
 }
開發者ID:garbetjie,項目名稱:wechat,代碼行數:7,代碼來源:Link.php

示例4: __construct

 public function __construct($sender, $recipient, $messageID, $createdDate, array $coordinates, $scale, $label)
 {
     parent::__construct($sender, $recipient, $messageID, $createdDate);
     $this->coordinates = $coordinates;
     $this->scale = $scale;
     $this->name = $label;
 }
開發者ID:garbetjie,項目名稱:wechat,代碼行數:7,代碼來源:Location.php

示例5: __construct

 /**
  * @param OutputInterface $output
  * @throws RuntimeException
  */
 public function __construct(OutputInterface $output)
 {
     if (!function_exists('readline')) {
         throw new RuntimeException('You must activate the readline extension');
     }
     parent::__construct($output);
 }
開發者ID:ratibus,項目名稱:pflow,代碼行數:11,代碼來源:Readline.php

示例6: __construct

 public function __construct($sender, $recipient, $messageID, $createdDate, $mediaID, $format, $recognizedSpeech)
 {
     parent::__construct($sender, $recipient, $messageID, $createdDate);
     $this->recognition = $recognizedSpeech;
     $this->format = $format;
     $this->mediaID = $mediaID;
 }
開發者ID:garbetjie,項目名稱:wechat,代碼行數:7,代碼來源:Audio.php

示例7: Dropdown

 /**
  * construct Input
  * @param string $name
  * @param string $week
  */
 function __construct($name, $week = null)
 {
     parent::__construct($name, $week);
     // create week and year dropdown objects
     $this->year = new Dropdown($this->name . '-year');
     $this->year->setValues(range(date('Y') - 3, date('Y') + 1))->setLabels(range(date('Y') - 3, date('Y') + 1))->setSelected(date('Y'))->setWidth(65);
     // create array with week numbers from 01 to 53
     $weeks = range(1, 53);
     array_walk($weeks, function (&$nr) {
         $nr = str_pad($nr, 2, '0', STR_PAD_LEFT);
     });
     $this->week = new Dropdown($this->name . '-week');
     $this->week->setValues($weeks)->setLabels($weeks)->setSelected(date('W'))->setWidth(52);
     $this->attachObserver($this->year);
     $this->attachObserver($this->week);
     $this->addClass('week-dropdown');
     // this will be the field we will actually fetch when posted, because that's easier. ;)
     // we need javascript to fill it when the dropdowns change, tho.
     $this->hiddenInput = new HiddenInput($name, date('Y-W'));
     if (!empty($week)) {
         $this->setSelected($week);
     }
     // store posted as selected
     $this->setPosted();
 }
開發者ID:winkbrace,項目名稱:winkform,代碼行數:30,代碼來源:WeekInput.php

示例8: __construct

 /**
  * Class constructor.
  * pass in alternate to $_REQUEST
  */
 public function __construct($data = NULL)
 {
     if ($data === NULL) {
         $data = $_REQUEST;
     }
     parent::__construct($data);
     $trim_chars = "/\n\r\t\v ";
     $this->uri = isset($_SERVER['REQUEST_URI']) ? '/' . trim($_SERVER['REQUEST_URI'], $trim_chars) : '/';
     if (isset($this->{'_'})) {
         $action = $this->{'_'};
     } else {
         if (isset($_SERVER['PATH_INFO'])) {
             $action = $_SERVER['PATH_INFO'];
         } else {
             $pos = strpos($this->uri, '?');
             $action = $pos === FALSE ? $this->uri : substr($this->uri, 0, $pos);
         }
     }
     $script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
     $action = str_replace(array($script_name, $script_name . '?_='), '', $action);
     $action = trim($action, $trim_chars);
     $this->action = '/' . $action;
     if (strpos($this->uri, $script_name) === 0) {
         $this->base = $script_name;
     } else {
         $this->base = '';
     }
 }
開發者ID:Gaia-Interactive,項目名稱:gaia_core_php,代碼行數:32,代碼來源:request.php

示例9: __construct

 public function __construct($fieldName, $fieldInfo, $value)
 {
     if (empty($value)) {
         $value = 0;
     }
     parent::__construct($fieldName, $fieldInfo, $value);
 }
開發者ID:gudwin,項目名稱:extasy,代碼行數:7,代碼來源:Integer.php

示例10: __construct

 public function __construct($name = null, $owner = null, $src = "здесь будет адрес рисунка", $alt = "текст вместо рисунка", $title = "комментарий о рисунке")
 {
     parent::__construct($name, $owner);
     $this->type = "image";
     $this->title = $title;
     $this->alt = $alt;
     $this->src = $src;
 }
開發者ID:popytka008,項目名稱:classes,代碼行數:8,代碼來源:InputImage.php

示例11: __construct

 public function __construct($name = null, $owner = null, $value = null)
 {
     parent::__construct($name, $owner, $value);
     $this->type = "text";
     if ($value == "") {
         $this->value = "Писать сюда и сидя";
     }
 }
開發者ID:popytka008,項目名稱:classes,代碼行數:8,代碼來源:TextField.php

示例12:

 function __construct()
 {
     parent::__construct();
     //add checked as a valid attribute
     $this->addValidAttribute('checked');
     $this->setAttribute('type', 'checkbox');
     //type to checkbox
 }
開發者ID:AnthonyMassie,項目名稱:MVC-Framework-for-WP-Plugins,代碼行數:8,代碼來源:Checkbox.php

示例13: __construct

 public function __construct($field)
 {
     parent::__construct($field);
     $this->attributes['maxsize'] = 'maxsize';
     //set the encoding type for the parent form
     $field->getForm()->setEncType('multipart/form-data');
     $this->type = 'file';
 }
開發者ID:jazzee,項目名稱:foundation,代碼行數:8,代碼來源:FileInput.php

示例14: __construct

 public function __construct($array, $splat_)
 {
     $splat = [];
     while (!empty($splat_)) {
         $key = array_pop($splat_);
         $splat[$key] = array_pop($splat_);
     }
     parent::__construct($array, $splat);
 }
開發者ID:appsuite-com-au,項目名稱:gossamer,代碼行數:9,代碼來源:splatinput.php

示例15: __construct

 /**
  * ArgvInput constructor.
  */
 public function __construct(array $args = null)
 {
     if (null === $args) {
         $args = $_SERVER['argv'];
     }
     array_shift($args);
     $this->arguments = $args;
     parent::__construct();
 }
開發者ID:sylabs,項目名稱:syph-framework,代碼行數:12,代碼來源:ArgvInput.php


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