template::list::get_reference (public)

 template::list::get_reference -name name [ -local_name local_name ] \
    [ -create ]

Defined in packages/acs-templating/tcl/list-procs.tcl

Bind an upvar reference to a variable at the template parse level to a local variable, optionally giving an error message if it doesn't exist.

Switches:
-name
(required)
Name of the variable at the template parse level.
-local_name
(defaults to "list_properties") (optional)
Name of the local variable to bind the reference to, default "list_properties".
-create
(boolean) (optional)
Boolean which if true suppresses the "not found" error return, for instance when you're building the reference in order to create a new list.

Partial Call Graph (max 5 caller/called nodes):
%3 template::list::create template::list::create (public) template::list::get_reference template::list::get_reference template::list::create->template::list::get_reference template::list::element::create template::list::element::create (public) template::list::element::create->template::list::get_reference template::list::element::get_reference template::list::element::get_reference (public) template::list::element::get_reference->template::list::get_reference template::list::element::render template::list::element::render (public) template::list::element::render->template::list::get_reference template::list::element::set_property template::list::element::set_property (public) template::list::element::set_property->template::list::get_reference template::adp_level template::adp_level (public) template::list::get_reference->template::adp_level template::list::get_refname template::list::get_refname (public) template::list::get_reference->template::list::get_refname

Testcases:
No testcase defined.
Source code:
    if {$name eq ""} {
        error "Attempt to get reference to an empty name."
    }
    set refname [get_refname -name $name]

    if { !$create_p && ![uplevel \#[template::adp_level] [list info exists $refname]] } {
        error "List '$name' not found"
    }

    uplevel upvar #[template::adp_level$refname $local_name
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: