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 :
- getName() : it returns the name of the new variable (ex: "modelDir")
- execute(Object obj) : defines the operation which is done on the path when the variable is found.
Second, you have to add this one to the variables registry like this :
ComposerVariableInterpreter.
INSTANCE.
addNewVariable(myVariable);