Multirow

Templating System : API Reference

Summary

Access and modify rows and columns of a multirow data source.

Methods

multiow get name index column

Get a particular column value or a reference to an entire row.

multiow set name index column value

Set the value of a column in a specified row.

multiow size name

Get the number of rows in the data source.

multiow create name column [column ...]

Set up a new multirow data source. This is an alternative to having db_multirow create the data source.

multiow append name value [value ...]

Add a row at the end of the data source. Extra values are dropped, missing values default to the empty string

multiow map name body

Evaluate body for each row of the data source, and return a list with all results. Within the body, all columns of the current row are accessible (and modifiable) as local variables. (Not yet committed.)

Examples

  template::query foo multirow "select first_name, last_name from users"

  # get the first name of the first user
  set first_name [multirow get foo 1 first_name]

  # get a reference to the entire row
  multirow get foo 1

  # this will the full name of the first user
  set full_name "$foo(first_name) $foo(last_name)"

Note(s)


templating@arsdigita.com