Now that we have discovered situations in which PHx becomes helpful, we will learn the PHx syntax.
PHx can be used to format any template variable by using a simple syntax. The syntax is generally like this:
[+templatevariablename:modifier+]. You can use the
[+ +] syntax, or the
[* *], syntax just like you do for any other template variable.
Modifiers are special keywords that transform the value of the template variable. We have modifiers to change a string to uppercase, to lowercase, the first character to uppercase, and so on.
For example: If we have a template variable
Occupation with the value
[+occupation:ucfirst+] will return
The following is a list of the most commonly used modifiers: