Package

ViewHelpers

ViewHelper Documentation

v:condition.variable.isset

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)}

Arguments

then anySimpleType

Value to be returned if the condition if met.

else anySimpleType

Value to be returned if the condition if not met.

name string

ViewHelper Resources

Schema Resources