ControlLibrary
in package
Uses
Singleton
Manages Builder form control library.
Tags
Table of Contents
- DEFAULT_DESIGN_TIME_PROVIDER = 'RainLab\Builder\Widgets\DefaultControlDesignTimeProvider'
- GROUP_STANDARD = 0
- GROUP_WIDGETS = 1
- $controls : mixed
- $groupedControls : mixed
- $instance : mixed
- __clone() : mixed
- __wakeup() : mixed
- forgetInstance() : mixed
- Forget this singleton's instance if it exists
- getControlInfo() : array<string|int, mixed>
- Returns information about a control by its code.
- getStandardProperties() : mixed
- instance() : mixed
- Create a new instance of this singleton.
- listControls() : array<string|int, mixed>
- Returns a list of all known form controls grouped by control groups.
- registerControl() : mixed
- Registers a control.
- __construct() : mixed
- Constructor.
- init() : mixed
- Initialize the singleton free from constructor parameters.
- resolveControlGroupName() : mixed
Constants
DEFAULT_DESIGN_TIME_PROVIDER
public
mixed
DEFAULT_DESIGN_TIME_PROVIDER
= 'RainLab\Builder\Widgets\DefaultControlDesignTimeProvider'
GROUP_STANDARD
public
mixed
GROUP_STANDARD
= 0
GROUP_WIDGETS
public
mixed
GROUP_WIDGETS
= 1
Properties
$controls
protected
mixed
$controls
= []
$groupedControls
protected
mixed
$groupedControls
= null
$instance
protected
static mixed
$instance
Methods
__clone()
public
__clone() : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —forgetInstance()
Forget this singleton's instance if it exists
public
final static forgetInstance() : mixed
Return values
mixed —getControlInfo()
Returns information about a control by its code.
public
getControlInfo(string $code) : array<string|int, mixed>
Parameters
- $code : string
-
Specifies the control code.
Return values
array<string|int, mixed> —Returns an associative array or null if the control is not registered.
getStandardProperties()
public
getStandardProperties([mixed $excludeProperties = [] ][, mixed $addProperties = [] ]) : mixed
Parameters
- $excludeProperties : mixed = []
- $addProperties : mixed = []
Return values
mixed —instance()
Create a new instance of this singleton.
public
final static instance() : mixed
Return values
mixed —listControls()
Returns a list of all known form controls grouped by control groups.
public
listControls([bool $returnGrouped = true ]) : array<string|int, mixed>
Parameters
- $returnGrouped : bool = true
-
Indicates whether controls should be grouped in the result.
Return values
array<string|int, mixed> —registerControl()
Registers a control.
public
registerControl(string $code, string $name, string $description, string|int $controlGroup, string $icon, array<string|int, mixed> $properties, string $designTimeProviderClass) : mixed
Parameters
- $code : string
-
Specifies the control code, for example "codeeditor".
- $name : string
-
Specifies the control name, for example "Code editor".
- $description : string
-
Specifies the control descritpion, can be empty.
- $controlGroup : string|int
-
Specifies the control group. Control groups are used to create tabs in the Control Palette in Form Builder. The group could one of the ControlLibrary::GROUP_ constants or a string.
- $icon : string
-
Specifies the control icon for the Control Palette.
- $properties : array<string|int, mixed>
-
Specifies the control properties. The property definitions should be compatible with Inspector properties, similarly to the Component properties: http://octobercms.com/docs/plugin/components#component-properties Use the getStandardProperties() of the ControlLibrary to get the standard control properties.
- $designTimeProviderClass : string
-
Specifies the control design-time provider class name. The class should extend RainLab\Builder\Classes\ControlDesignTimeProviderBase. If the class is not provided, the default control design and design settings will be used.
Tags
Return values
mixed —__construct()
Constructor.
protected
final __construct() : mixed
Return values
mixed —init()
Initialize the singleton free from constructor parameters.
protected
init() : mixed
Return values
mixed —resolveControlGroupName()
protected
resolveControlGroupName(mixed $group) : mixed
Parameters
- $group : mixed