{/doc/acs-templating {ACS Templating}} {Templating System API: Multirow} Templating System API: Multirow

Multirow

Templating System : API Reference

Summary

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

Methods

multirow getname index column

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

multirow setname index column value

Set the value of a column in a specified row.

multirow sizename

Get the number of rows in the data source.

multirow createname column [column ...]

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

multirow appendname value [value ...]

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

multirow mapname 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)