本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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 = '';
}
}
示例9: __construct
public function __construct($fieldName, $fieldInfo, $value)
{
if (empty($value)) {
$value = 0;
}
parent::__construct($fieldName, $fieldInfo, $value);
}
示例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;
}
示例11: __construct
public function __construct($name = null, $owner = null, $value = null)
{
parent::__construct($name, $owner, $value);
$this->type = "text";
if ($value == "") {
$this->value = "Писать сюда и сидя";
}
}
示例12:
function __construct()
{
parent::__construct();
//add checked as a valid attribute
$this->addValidAttribute('checked');
$this->setAttribute('type', 'checkbox');
//type to checkbox
}
示例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';
}
示例14: __construct
public function __construct($array, $splat_)
{
$splat = [];
while (!empty($splat_)) {
$key = array_pop($splat_);
$splat[$key] = array_pop($splat_);
}
parent::__construct($array, $splat);
}
示例15: __construct
/**
* ArgvInput constructor.
*/
public function __construct(array $args = null)
{
if (null === $args) {
$args = $_SERVER['argv'];
}
array_shift($args);
$this->arguments = $args;
parent::__construct();
}