Variable substitution system: Difference between revisions

Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
Line 1,169: Line 1,169:
The array to define all substitution variables is defined in code by calling the method  
The array to define all substitution variables is defined in code by calling the method  
<code>$substitutionarray = getCommonSubstitutionArray().</code>
<code>$substitutionarray = getCommonSubstitutionArray().</code>
This method receive the $object in parameter, so it can define the content of the substitution array using properties of this object.
This method receive the $object in parameter, so it can define the content of the substitution array using properties of this object. No database access and no IO are allowed to set the substitution array.


Then the array will be used by calling the make_substitutions() this way:
Then the array will be used by calling the make_substitutions() this way:
<code>$textcompleted = make_substitutions($textwithsubtitutionkeys, $substitutionarray)</code>
<code>$textcompleted = make_substitutions($textwithsubtitutionkeys, $substitutionarray)</code>


However, sometimes to value to use is not available into the $object, neither into the environment, and it needs a database access to get the value.
However, sometimes to value to use is not available into the $object, neither into the environment, and it needs a database access to get the value.

Navigation menu