\SpinnerField
An input field that uses jQuery UI's customizable spinner widget to provide a nice interface for fields that require number input with specific validation.
- Author: Janne Klouman <janne@klouman.com>
- License: https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause
Synopsis
class SpinnerField
extends NumericField
{
- // members
- protected array $spinnerUIOptions = ;
- protected bool $enforceStepValidation = false;
- protected bool $enforceBelowMinValidation = true;
- protected bool $enforceAboveMaxValidation = true;
- public static array $available_ui_options = ;
- // methods
- public void __construct()
- public array getUIOptions()
- public $this setUIOptions()
- public mixed getUIOption()
- public bool setUIOption()
- public bool getEnforceStepValidation()
- public bool setEnforceStepValidation()
- public bool getEnforceBelowMinValidation()
- public bool setEnforceBelowMinValidation()
- public bool getEnforceAboveMaxValidation()
- public bool setEnforceAboveMaxValidation()
- public bool isValidUIOption()
- public HTMLText Field()
- public bool validate()
Hierarchy
Extends
- NumericField
Members
protected
- $enforceAboveMaxValidation
—
bool
Will cause validation to fail if input is above the 'max' UI option. - $enforceBelowMinValidation
—
bool
Will cause validation to fail if input is below the 'min' UI option. - $enforceStepValidation
—
bool
Will cause validation to fail if input is not evenly divisible with the 'step' UI option. Example: if 'step' is set to 4, validation will fail for 0 !== $input % 4 - $spinnerUIOptions
—
array
Options that will be passed to the jQuery UI spinner's initialization method. Set by using $this->setUIOption(), or $this->setUIOptions()
public
- $available_ui_options
—
array
Available option keys.
Methods
public
- __construct() — Constructor.
- Field() — The actual spinner field.
- getEnforceAboveMaxValidation()
- getEnforceBelowMinValidation()
- getEnforceStepValidation()
- getUIOption() — Get a specific option based on key.
- getUIOptions()
- isValidUIOption() — Check if a UI option key exists.
- setEnforceAboveMaxValidation()
- setEnforceBelowMinValidation()
- setEnforceStepValidation()
- setUIOption() — Set a UI option value based on key. See self::$available_ui_options.
- setUIOptions() — Takes a multidimensional array to set spinner options that will be put into the javascript file.
- validate() — Validation for this field.