本文整理汇总了PHP中NumericField::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP NumericField::__construct方法的具体用法?PHP NumericField::__construct怎么用?PHP NumericField::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NumericField
的用法示例。
在下文中一共展示了NumericField::__construct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param string $name
* @param null|string $title
* @param string $value
* @param null|array $options
*/
public function __construct($name, $title = null, $value = '', array $options = null)
{
if ($options) {
$this->setUIOptions($options);
}
parent::__construct($name, $title, $value);
}
示例2:
/**
* Create a new field.
* @param string $name The internal field name, passed to forms.
* @param string $title The field label.
* @param string $value The value of the field.
* @param integer $min The minimum allowed value
* @param integer $max The maximum allowed value
* @param integer $step The increments to increase bye
* @param string $prefix Prefixed to the value for display purposes
* @param string $suffix Appended to the value for display purposes
* @param string $width CSS width for sizing the slider itself (default is "50%")
* @param Form $form Reference to the container form
* @param string $rightTitle
*/
function __construct($name, $title = null, $value = null,
$min = 0, $max = 100, $step = 1, $prefix = null, $suffix = null, $width = "50%",
$form = null, $rightTitle = null) {
$this->name = $name;
$this->title = ($title === null) ? $name : $title;
$this->setMinimum($min);
$this->setMaximum($max);
$this->setStep($step);
$this->setPrefix($prefix);
$this->setSuffix($suffix);
$this->setWidth($width);
if($value !== NULL) $this->setValue($value);
if($form) $this->setForm($form);
parent::__construct($name, $title, $value, $form, $rightTitle);
}
示例3: __construct
/**
* Create a SliderField object
*
* @param string $name
* @param string $title
* @param integer $minimum
* @param integer $maximum
* @param integer $value
* @param integer $maxLength
* @param Form $form
*/
public function __construct($name, $title = null, $minimum = null, $maximum = null, $value = '', $maxLength = null, $form = null)
{
parent::__construct($name, $title, $value, $maxLength, $form);
$this->setMaximum($maximum);
$this->setMinimum($minimum);
}