Maslosoft Framework Logo Maslosoft Framework Documentation
Flexible Application Foundation


Toolbar

This widget creates set of buttons bound to it's actions. Buttons can have numerous and growing list of options.

Example of basic configuration of Toolbar with one button. Consult Toolbar Button documentation for details, as it is not directly related to Toolbar itself.

Note that $buttons property is array of array of button configurations.

echo Toolbar::widget([
	'buttons' => [
		[
			'binding' => false,
			'label' => 'MyButton',
			'action' => 'alert'
		]
	]
]);

Full list of configurable options of toolbar include:

Property Documentation
$binding

Base binding for actions binding, this will be prepended to any action JavaScript reference.

$buttonSet

(Predefined) Button set to apply to toolbar Use special value of Toolbar::Current, which will be replaced by buttons configuration, thus allowing to inject buttons between button sets.

$buttons

Buttons for this toolbar, can be inserted into buttonSet or used alone to configure toolbar without extra preset.

$caption

Toolbar caption, displayed above toolbar, specially useful for floating toolbars

$dark

Leave null to autodetect dark mode, ie when it is floating.

By defaults it is not dark, the value is set in init method.

$floating

Will add ovr class for floating toolbar

$horizontal

Horizontal, or vertical toolbar

$hotkeyScope

Scope for hotkeys

$hotkeyScopeLabel
$id

Id of widget.

This might be used by widget in HTML, but no assumptions should be taken for that matter. ID's are in many cases generated automatically and it's value might change between page loads.

$inlined

Set this to true to display toolbar as inline-block element. This is suitable to place toolbar as a grid item.

$jsRef

Js widget instance. This is JavaScript reference to current widget client side implementation.

This allows to invoke JavaScript methods, or set object properties with PHP. This will not encode value automatically, allowing to set JavaScript reference as a method parameter or property value.

Example of invoking method:

$widget->jsRef->setName(JavaScript::encode('Some name'));

Example of setting property:

$widget->jsRef->name = JavaScript::encode('Some name');
$model

Model on which widget will operate.

It is recommended for model to implement AnnotatedInterface.

$tooltipPlacement