Documentation · ViewHelper reference

XSD schema file | vhs 2.1.3

Variable / UnsetViewHelper

Variable: Unset

Quite simply, removes a currently available variable from the TemplateVariableContainer:

<!-- Data: {person: {name: 'Elvis', nick: 'King'}} -->
I'm {}. Call me "{person.nick}". A ding-dang doo!
<v:variable.unset name="person" />
<f:if condition="{person}">
        You saw this coming...
        <em>Elvis has left the building</em>

At the time of writing this, v:variable.unset is not able to remove members of for example arrays:

<!-- DOES NOT WORK! -->
<v:variable.unset name="myObject.propertyName" />
  • Tag usage example

    <v:variable.unset name="NULL">
    	<!-- tag content - may be ignored! -->
  • Inline usage example

    {v:variable.unset(name: 'NULL')}


Argument Description Type
name string
Required attribute

Revision history

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

    [TASK] Switch to namespaces

commit f16494865266f00f4df185236b7856aa96841039
Author: Xaver Maierhofer <*****>
Date:   Sat Jun 7 22:58:04 2014 +0200

    [TASK] Replace old namespace and move v:if to v:condition and v:var to v:variable in documentaion and readme

commit 12ff0ddfb8d36c51f2d3befde7ae812177c80d5d
Author: Xaver Maierhofer <*****>
Date:   Wed Jun 11 00:01:47 2014 +0200

    [TASK] CGL remove use leading backslash
    PHP Docs
    Note that for namespaced names (fully qualified namespace names containing namespace separator, such as Foo\Bar as opposed to global names that do not, such as FooBar),
    the leading backslash is unnecessary and not recommended, as import names must be fully qualified, and are not processed relative to the current namespace.

commit 716b251b6470782dbc09ca6e883b00cb75e5e440
Author: Claus Due <*****>
Date:   Thu Jan 15 04:52:28 2015 +0100

    [TASK] More test ports

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

    [TASK] Reference Copyright to file