Helpers:array

From Dwoo Docs

(Redirected from Array)
Jump to: navigation, search

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 array(name="Bob" gender="male") user}
{$user.name} is {$user.gender}

Output:

Bob is male

Auto-indexed Array Examples:

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

Output:

First user is : Bob
User list : Bob John
Personal tools
templates
page language

French

The article you want to access doesn't exist in French.
Deutsch
The article you want to access doesn't exist in Deutsch.
Russian
The article you want to access doesn't exist in Russian.