Documentation · ViewHelper reference

XSD schema file | vhs master

Once / SessionViewHelper

Once: Session

Displays nested content or "then" child once per session.

"Once"-style ViewHelpers are purposed to only display their nested content once per XYZ, where the XYZ depends on the specific type of ViewHelper (session, cookie etc).

In addition the ViewHelper is a ConditionViewHelper, which means you can utilize the f:then and f:else child nodes as well as the "then" and "else" arguments. /

  • Tag usage example

    <v:once.session then="[mixed]" else="[mixed]" condition="1" identifier="NULL" lockToDomain="1" ttl="123">
    	<!-- tag content - may be ignored! -->
    </v:once.session>
  • Inline usage example

    {v:once.session(then: [mixed], else: [mixed], condition: 1, identifier: 'NULL', lockToDomain: 1, ttl: 123)}

Arguments

Argument Description Type
condition

Condition expression conforming to Fluid boolean rules

boolean
else

Value to be returned if the condition if not met.

mixed
identifier

Identity of this condition - if used in other places, the condition applies to the same identity in the storage (i.e. cookie name or session key)

string
lockToDomain

If TRUE, locks this condition to a specific domain, i.e. the storage of $identity is associated with a domain. If same identity is also used without domain lock, it matches any domain locked condition

boolean
then

Value to be returned if the condition if met.

mixed
ttl

Time-to-live for skip registration, number of seconds. After this expires the registration is unset

integer
Required attribute

Revision history

commit a91d4baa505c466cf42b205fd62ce07c460134da
Author: Claus Due <*****@wildside.dk>
Date:   Sun Nov 25 15:48:54 2012 +0100

    [FEATURE] Once / Standard, Instance, Cookie and Session ViewHelpers

commit 3a09c20b1fce74b9d0f5d57f99f0853490bed3ac
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Tue Jun 18 10:21:10 2013 +0200

    [TASK] Code cleanup

commit da31bad1d9bb058c072ddb5591e8ed907a1ae8e1
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 31 23:08:37 2013 +0100

    [TASK] Happy new year!

commit 52bd6e41ccfef3d8193b350153912a9716e6a087
Author: Benjamin Rau <*****@codearts.at>
Date:   Tue Apr 1 21:09:00 2014 +0200

    [TASK] CGL compliance

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

    [TASK] Switch to namespaces

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

    [TASK] Reference Copyright to license.md file