Template $variable Modifiers

  • what are variable modifiers?

    Variable modifiers are functions that get applied to a variable to change its output.

    In JR5 you can use all the variable modifiers that are available to smarty.

    Smarty Variable Modifiers Help section:
    http://www.smarty.net/docsv2/en/language.modifiers

    and more.

    Jamroom provides its own variable modifiers to extend the ones you get with smarty too.

    In the following chapters we will look at some of the Jamroom defined variable modifiers.
  • example

    an example of a variable modifier is jrCore_format_time

    It takes a unix timestamp and re-formats it to a readable time.

    eg: {$profile_split} will output a timestamp in a template that reads like this:
    1387746000

    Thats a date, but not one humans are used to reading. We can make it human readable by adding the |jrCore_format_time variable modifier
    {$profile_split|jrCore_format_time}
  • after applying that variable modifier the output will be:
    23/12/13 00:00:00

    See the jrCore_format_time page for more details on that particular smarty variable modifier.

Tags