NAME

Top Close Open

Template::TT3::Type::List - list virtual object

SYNOPSIS

Top Close Open
# TODO

DESCRIPTION

Top Close Open

Note: we use the term 'list' interchangeably with 'array' here. Technically speaking we mean "reference to an array" when we say "reference to a list" and so on, but we don't worry too much about the distinction in TT land.

Note: all these methods can be called as subroutines, passing a reference to an array as the first argument.

METHODS

Top Close Open

new()

Top Close Open

Constructor method to create a new List object. A reference to a List object, array or a list of parameters can be passed as argument(s) to define the contents of the List object. If a List object is passed as an argument then it is first cloned. If a reference to an array is passed then it is blessed into a List object without being copied. If a list of parameters is passed then they are merged into a new array which is then blessed and returned as a List object.

clone()

Top Close Open

Creates a new List object as a copy of the current one. A reference to a List object, array or a list of argument can be passed to define any additional data items to be added to the cloned List object.

ref()

Top Close Open

Returns the string 'ARRAY', equivalent to Perl's ref() function.

type()

Top Close Open

Returns the string 'List' to indicate the TT data type.

copy()

Top Close Open

Returns a reference to an unblessed array containing a copy of the current List object and any additional items passed by reference to another list object, array or as a list of arguments.

hash()

Top Close Open

TODO

list()

Top Close Open

TODO

text($delim)

Top Close Open

TODO

join($delim)

Top Close Open

TODO

item()

Top Close Open

TODO

first()

Top Close Open

TODO

last()

Top Close Open

TODO

max()

Top Close Open

TODO

size()

Top Close Open

TODO

grep()

Top Close Open

TODO

sort()

Top Close Open

TODO

nsort()

Top Close Open

TODO

unique()

Top Close Open

TODO

reverse()

Top Close Open

TODO

slice()

Top Close Open

TODO

MORE METHODS TODO

Top Close Open

AUTHOR

Top Close Open

Andy Wardley <abw@wardley.org>

TODO

Top Close Open

sort() and nsort() should take named parameters.

[% list.sort(field => 'name') %] rather than [% list.sort('name') %]

VERSION

Top Close Open

$Revision: 1.2 $

COPYRIGHT

Top Close Open

Copyright (C) 1996-2004 Andy Wardley. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


http://tt3.template-toolkit.org/docs/Template/TT3/Type/List.pm last modified 2009-12-23 14:54:58