PHPackages                             elao/parameterizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. elao/parameterizer

AbandonedArchivedLibrary

elao/parameterizer
==================

Elao Parameterizer

1.0.1(11y ago)0421MITPHPPHP &gt;=5.3.3

Since Jul 2Pushed 11y ago19 watchersCompare

[ Source](https://github.com/Elao/ElaoParameterizer)[ Packagist](https://packagist.org/packages/elao/parameterizer)[ Docs](https://github.com/Elao/ElaoParameterizer)[ RSS](/packages/elao-parameterizer/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

ElaoParameterizer
=================

[](#elaoparameterizer)

[![Latest Stable Version](https://camo.githubusercontent.com/edecefe2b3bb970e0f49f2a5b41345993722ef7a452dea493f84921c894b063c/68747470733a2f2f706f7365722e707567782e6f72672f656c616f2f706172616d65746572697a65722f762f737461626c652e737667)](https://packagist.org/packages/elao/parameterizer)[![Total Downloads](https://camo.githubusercontent.com/7fd15317808a64d03603e376fb84c7ac21481c094fa70c4ae199a2ab78a8e671/68747470733a2f2f706f7365722e707567782e6f72672f656c616f2f706172616d65746572697a65722f646f776e6c6f6164732e737667)](https://packagist.org/packages/elao/parameterizer)[![Latest Unstable Version](https://camo.githubusercontent.com/5b3cc379f14da0d1a466fbff31750d9ced181b9ccc88278b379c688e5e5b7f0b/68747470733a2f2f706f7365722e707567782e6f72672f656c616f2f706172616d65746572697a65722f762f756e737461626c652e737667)](https://packagist.org/packages/elao/parameterizer)[![License](https://camo.githubusercontent.com/2ff028609d78dd692e4a24d3da256e028fb83c11e8cb3c4b4a23f999b2541771/68747470733a2f2f706f7365722e707567782e6f72672f656c616f2f706172616d65746572697a65722f6c6963656e73652e737667)](https://packagist.org/packages/elao/parameterizer)

[![Build Status](https://camo.githubusercontent.com/c6ad93efe8cf3e31bfbd2626c26c1d75fd17075344031d7ad10e24b00a1ae269/68747470733a2f2f7472617669732d63692e6f72672f456c616f2f456c616f506172616d65746572697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Elao/ElaoParameterizer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4a606d67139f81867a9e6ca1c1f58ba60703f6f29c7cafa97b1204d15e9f1892/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f456c616f2f456c616f506172616d65746572697a65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Elao/ElaoParameterizer/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/959e0efb813a98adce4976c2b76ecf9d963a94510a43590620a9dc3bb6621211/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f456c616f2f456c616f506172616d65746572697a65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Elao/ElaoParameterizer/?branch=master)

Description:
------------

[](#description)

This component provides a set of classes to handle some service parameters in a structured way, and a twig [dat.GUI](http://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage) extension to set them with style.

A symfony [ElaoParameterizerBundle](https://github.com/Elao/ElaoParameterizerBundle) also exists to simplify integration in your project.

Installation:
-------------

[](#installation)

Add ElaoParameterizer in your composer.json:

```
{
    "require": {
        "elao/elao/parameterizer": "1.0.*"
    }
}

```

Now tell composer to download the library by running the command:

```
$ php composer.phar update elao/parameterizer

```

How to use it:
--------------

[](#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.

```
$factory = new ParameterizerFactory(new Inflector());

// Create a "foo" named parameterizer
$parameterizer = $factory->create('foo');

$parameterizer
	// Create a "foo" named pattern
	->create('foo')
		// Create a "bar" named parameter with a "baz" value
 		->create('bar', 'baz')
		// Create a "dinosaur" named parameter with a 42 value
 		->create('dinosaur', 42);

```

#### Options

[](#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.

```
$pattern->setOptions(array('foo' => 'bar'));

// bar
$pattern->getOption('foo');
// 123 (default value, as "bar" options does not exists)
$pattern->getOption('bar', 123);
// Label
$pattern->getOption('label');

```

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.

```
$parameter->setOptions(array('min' => 1, 'max' => 2));

// 1
$parameter->getOption('min');
// null (default value, as "step" options does not exists)
$parameter->getOption('step');
// Label
$parameter->getOption('label');

```

#### Values

[](#values)

At each level, you can get and merge values to communicate and synchronize with the real world.

```
// Gives a pattern indexed array of indexed parameter values array
$parameterizer->getValues();
// Merge
$parameterizer->mergeValues(array('foo' => array('bar' => 'baz')));

// Get indexed parameter values array
$pattern->getValues();
// Merge
$pattern->mergeValues(array('bar' => 'baz'));
// Get foo parameter value
$pattern->getValue('bar');
// Set foo parameter value
$pattern->setValue('bar', 'baz');

// Get value
$parameter->getValue();
// Set value
$parameter->setValue();

```

#### Interface

[](#interface)

An **Parameterizable** interface is provided to harmonize your code.

#### dat.GUI twig extension

[](#datgui-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.

```

    var gui = new dat.GUI();
    {{ elao_parameterizer_dat_gui_render_javascript({'gui': 'gui'}) }}

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4338d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/623877?v=4)[Elao](/maintainers/Elao)[@Elao](https://github.com/Elao)

---

Tags

elaoparameterizer

### Embed Badge

![Health badge](/badges/elao-parameterizer/health.svg)

```
[![Health](https://phpackages.com/badges/elao-parameterizer/health.svg)](https://phpackages.com/packages/elao-parameterizer)
```

###  Alternatives

[elao/form-translation-bundle

Generate translation key for forms

44225.4k1](/packages/elao-form-translation-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
