Documentation · ViewHelper reference

XSD schema file | vhs 2.1.4

Condition / Variable / IssetViewHelper

Variable: Isset

Renders the then child if the variable name given in the name argument exists in the template. The value can be zero, NULL or an empty string - but the ViewHelper will still return TRUE if the variable exists.

Combines well with dynamic variable names:

<!-- if {variableContainingVariableName} is "foo" this checks existence of {foo} -->
<v:condition.variable.isset name="{variableContainingVariableName}">...</v:condition.variable.isset>
<!-- if {suffix} is "Name" this checks existence of "variableName" -->
<v:condition.variable.isset name="variable{suffix}">...</v:condition.variable.isset>
<!-- outputs value of {foo} if {bar} is defined -->
{foo -> v:condition.variable.isset(name: bar)}
  • Tag usage example

    <v:condition.variable.isset then="[mixed]" else="[mixed]" name="NULL">
    	<!-- tag content - may be ignored! -->
  • Inline usage example

    {v:condition.variable.isset(then: [mixed], else: [mixed], name: 'NULL')}


Argument Description Type

Value to be returned if the condition if not met.

name string

Value to be returned if the condition if met.

Required attribute

Revision history

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to file