template::get_attribute (public)
template::get_attribute tag params name [ default ]
Defined in packages/acs-templating/tcl/parse-procs.tcl
Retrieves a named attribute value from the parameter set passed to a tag handler. If a default is not specified, assumes the attribute is required and throws an error.
- Parameters:
- tag (required)
- The name of the tag.
- params (required)
- The ns_set passed to the tag handler.
- name (required)
- The name of the attribute.
- default (optional, defaults to
"ERROR"
)- A default value to return if the attribute is not specified in the template. A default value of "ERROR" will cause the proc to throw an error if the attribute wasn't supplied.
- Returns:
- The value of the attribute.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set value [ns_set iget $params $name] if {$value eq ""} { if { $default eq "ERROR" } { error "Missing [string toupper $name] property in [string toupper $tag] tag" } else { set value $default } } return $valueXQL Not present: Generic, PostgreSQL, Oracle