Documentation · ViewHelper reference

XSD schema file | vhs 2.1.4

Iterator / RandomViewHelper

Returns random element from array

  • Tag usage example

    <v:iterator.random subject="[mixed]" as="NULL">
    	<!-- tag content - may be ignored! -->
    </v:iterator.random>
  • Inline usage example

    {v:iterator.random(subject: [mixed], as: 'NULL')}

Arguments

Argument Description Type
as

Which variable to update in the TemplateVariableContainer. If left out, returns the random element instead of updating the variable

string
subject mixed
Required attribute

Revision history

commit a4933a3b067fba5c90a5ebeb64046d4f46b71cfd
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Tue Jun 11 18:19:45 2013 +0200

    [FEATURE] Add iterator random element ViewHelper

commit ed15bec7ec1450244979567f31ea9e8b7c3bc374
Author: Claus Due <*****@namelesscoder.net>
Date:   Wed Nov 6 03:21:04 2013 +0100

    [FEATURE] ViewHelperUtility for reusable methods

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

    [TASK] Happy new year!

commit d2e531da034976e6db1478eef5a8478595fd16fe
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Jan 5 00:45:10 2014 +0100

    [TASK] Migrate to using namespace core class names

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 65ef3ba07a5f0cb9b26ccbfbfc205a4e8d145577
Author: Claus Due <*****@namelesscoder.net>
Date:   Sat Oct 11 14:58:45 2014 +0200

    [TASK] Refactor and cover Iterator / Merge, Pop, Random, Shift

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

    [TASK] Reference Copyright to license.md file