What ?

Composer offers an extension mechanism allowing to add new variable. Currently, it is possible to add own variable programmatically only by the ComposerVariableInterpreter.

How to ?

First, you have to define the new variable.

A variable definition have to implement the IComposerVariable interface. This interface defines two methods :

Second, you have to add this one to the variables registry like this :

ComposerVariableInterpreter. INSTANCE. addNewVariable(myVariable);