Documentation · ViewHelper reference

XSD schema file | vhs master

Iterator / SliceViewHelper

Slice an Iterator by $start and $length. /

  • Tag usage example

    <v:iterator.slice haystack="[mixed]" start="123" length="123" preserveKeys="1" as="NULL">
    	<!-- tag content - may be ignored! -->
    </v:iterator.slice>
  • Inline usage example

    {v:iterator.slice(haystack: [mixed], start: 123, length: 123, preserveKeys: 1, as: 'NULL')}

Arguments

Argument Description Type
as

Template variable name to assign; if not specified the ViewHelper returns the variable instead.

string
haystack

The input array/Traversable to reverse

mixed
length

Number of items to slice

integer
preserveKeys

Whether or not to preserve original keys

boolean
start

Starting offset

integer
Required attribute

Revision history

commit 01919b4d3b119f73e7cb218a0deb42e3c21ebde3
Author: Claus Due <*****@wildside.dk>
Date:   Sun Nov 25 03:06:59 2012 +0100

    [FEATURE] Iterator / Slice ViewHelper

commit aa32ca2050a4ac2d8ff0a2183b316c7c0f2477ed
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sun May 26 16:00:15 2013 +0200

    [TASK] A*****@throws annotations

commit 6fd4bc6ed90b9d29a9ea298d1f1202ec03994ee4
Author: Cedric Ziel <*****@cedric-ziel.com>
Date:   Sun Sep 29 16:39:37 2013 +0200

    [BUGFIX] Fix 'as' argument
    
    The as argument was not accessible, as the method signature and Doc-Comment was missing it

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 d4b2d6b54166818dbddf45daa6c8897eba11b42b
Author: Claus Due <*****@namelesscoder.net>
Date:   Mon Oct 13 19:53:35 2014 +0200

    [TASK] Refactor and cover Iterator / Slice ViewHelper

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

    [TASK] Reference Copyright to license.md file