M module

Support.module:Array

descirption...

Functions

Returns the last element of an array

Parameters

value : Array

The array to get the last element from

Returns

*

The last element of the array

Converts a value to an array If value is already an array, returns it unchanged If value has a toArray method, calls that method Otherwise, wraps the value in an array

Parameters

value : *

The value to convert to an array

Returns

Array

The value as an array

Calls to_param on all its elements and joins the result with slashes. This is used by url_for in Viking Pack.

Parameters

value : Array

The array to convert to a parameter string

Returns

string

A string with array values converted to parameters and joined with slashes

Converts an array into a string suitable for use as a URL query string, using the given key as the param name.

Parameters

value : Array

The array to convert to a query string

key : string

The key to use as the parameter name

Returns

string

A URL query string representation of the array