User Tools

Site Tools


en:developer:expression_language:basic_syntax

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

This documentation page is a member of the [[en:start|developer part]] of this wiki. ====== Expression Language ====== ===== Basic Syntax ===== The syntax of the recently added expression language (or EL for short) is kept as simple as possible to follow KISS. The expression code begins with a curly open brace and a percentage character (**{%**) followed by the expression name-space indicator which contains only literal characters and closes with a percentage character and a curly close brace (**%}**). Optional "pipe-through" functions which can be any PHP or own-written function that expects none or one parameter, are only two supported and added with a comma (**,**) right after the name-space indicator plus the function's name. The order is kept in inverted order, compared with PHP, so first the inner function then the outer one. Optional data is added right after the name-space indicator if no pipe-through functions are provided or right after the last pipe-through function and separated with one equals symbol (**=**). The data itself can be a valid expression code again but but not again. According to the above syntax, the following examples are all valid. ==== A simple, data-less expression code as seen in row templates: ==== ''**{%**[[en:developer:expression_language:appendix_tags:template|template]]**,**[[en:expression_language:appendix_commands:template:ColorSwitch|ColorSwitch]]**%}**'' ==== An expression code with dynamically inserted template data: ==== ''**{%**[[en:developer:expression_language:appendix_tags:pipe|pipe]]**,**[[en:developer:api:translateComma|translateComma]]**=**$content[points]**%}**'' ==== An expression code with static data: ==== ''**{%**[[en:developer:expression_language:appendix_tags:config|config]]**,**[[en:developer:api:translateComma|translateComma]]**=**[[en:developer:configuration:points_register|points_register]]**%}**'' ==== An expression code with two pipe-through functions: ==== //Please found a live example.// ==== A non-standard expression code with dynamic data and one pipe-through function: ==== ''**{%**[[en:developer:expression_language:appendix_tags:user|user]]**,**gender**,**[[en:developer:api:translateGender|translateGender]]**=**$userid**%}**'' ---- This page is also available in the following languages: [[de:developer:expression_language:basic_syntax|Deutsch]]

en/developer/expression_language/basic_syntax.1282396909.txt.gz · Last modified: 2010/08/21 15:21 by roland