Array Helpers — Dwoo PHP Template Engine

Documentation for Dwoo array helper functions. Create and manipulate PHP arrays directly within your Dwoo templates.

Creates a PHP array with the given input

array(array $rest)
  • rest : any number of values of variables, either with named parameters to build an associative array or without for an auto-indexed array




Associative Array Example:

{assign user array(name="Bob" gender="male")}
{$user.name} is {$user.gender}

Output:

Bob is male

Auto-indexed Array Examples:

{assign users array("Bob" "John")}
First user is : {$users.0}
User list : {foreach $users user}{$user} {/foreach}

Output:

First user is : Bob
User list : Bob John