User Tools

Site Tools


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

This is an old revision of the document!


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

Attributes

  • condition - a boolean condition or a number (0 evaluate to false and all other numbers to true). Operators supported: + - * / ( ) OR AND. The tags in the condition are always evaluated before the condition is calculated
  • true - The content (html text or template filename) to return if the condition evaluate to true
  • false - The content (html text or template filename) to return if the condition evaluate to false

Example

<#if condition="('<#page_title>' = '') and (<#url_PageNumber> > 1)" 
     true="the page title is empty and the page number is greater than 1"
     false="the page title is NOT empty or the page number is NOT greater than 1">
en/public/developer/template_system/tags/expression/caseof.1353002320.txt.gz · Last modified: 2012/11/15 21:58 by admin