pclib  2.3.2
Lightweight PHP framework
Common attributes of template tags

These attributes can be used in any template tag (element):

You can use following tag modificators:

datasource attributes
These attributes can be used in following elements: bind, select, check, radio, listinput
  • list
  • query
  • lookup
  • datasource

These attributes specify datasource of the element. The data are used for generating of select options, group of radio buttons or checkboxes or as lookup table for lookup field (bind).

Datasource can be specified as

Examples:

Lookup table is loaded into associative array $tpl->_FIELD->items. You can set this array even directly, if you need special treatment. Ex: $tpl->_AGREE->items = array(1 => 'Yes', 2 => 'No');

Warning
Lookup tables are loaded into memory when template is printed. It can be resource intensive if you are using big lookup tables.

(*) Note: Since version 1.5.0 you can use any template tag value in lookup query Ex: query "select ID,LABEL from TABLE where CATEG='{CATEG}'"