Download the PHP package elao/parameterizer without Composer
On this page you can find all versions of the php package elao/parameterizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elao/parameterizer
More information about elao/parameterizer
Files in elao/parameterizer
Package parameterizer
Short Description Elao Parameterizer
License MIT
Homepage https://github.com/Elao/ElaoParameterizer
Informations about the package parameterizer
ElaoParameterizer
Description:
This component provides a set of classes to handle some service parameters in a structured way, and a twig dat.GUI extension to set them with style.
A symfony ElaoParameterizerBundle also exists to simplify integration in your project.
Installation:
Add ElaoParameterizer in your composer.json:
Now tell composer to download the library by running the command:
How to use it:
Classes are structured in a hierarchical manner, where a single Parameterizer contains n Patterns, each one containing n Parameters.
Parameterizer
Pattern
Parameter
Parameter
Parameter
Pattern
Parameter
Parameter
All classes takes a name as argument, and Parameter an initial value.
A factory is provided to simplify the parameterizer creation, and each class provides a convenient method to simplify its children creation.
Options
A pattern can takes an array of options. One of them is "label", which, if not provided, is automatically set as a human readable version of the pattern name, via an inflector.
A parameter can also takes an array of options. Same rule applies for the label, and some extra options, such as "choices", "min", "max" and "set", are specific for dat.GUI integration.
Values
At each level, you can get and merge values to communicate and synchronize with the real world.
Interface
An Parameterizable interface is provided to harmonize your code.
dat.GUI twig extension
This extension provides a elao_parameterizer_dat_gui_render_javascript method, which render the javascript part of dat.GUI integration. It accepting an array of options, one of them, "gui" being a string of the name of the dat.GUI instance to use.