User Tools

Site Tools


en:public:developer:template_system:tags:expression:caseof

Table of Contents

<#CaseOf>

The purpose of the CaseOf is to allow the value of a variable or expression to control the flow of program execution via a multiway branch. The main reasons for using a CaseOf include improving clarity, by reducing otherwise repetitive coding

Parameters

Name Mandatory Description
Expression Yes An arbitrary expression (string or number). The tags in the expression are always evaluated first
Statement_<a> No The content (html text or template filename) to return if the expression evaluate to <a>
...
Statement_<n> No The content (html text or template filename) to return if the expression evaluate to <n>
Default No Default value to return if no result found (else raise an error)

Example

<#caseof expression="<#url_PageNumber>" 
         statement_0="their is no page"
         statement_1="their is at least 1 page"
         default="their is at least <#url_PageNumber> pages">
en/public/developer/template_system/tags/expression/caseof.txt · Last modified: 2012/11/19 11:51 by admin