SUIT Framework

Scripting Using Integrated Templates

Docs - getvariable

07/31/2010: SUIT 2.0.1 and Rulebox 1.1.0 released.

Available Since: Rulebox (1.0.0)

Get a variable based on a split string.

Syntax mixed templating.getvariable ( str string, str split, mixed owner )
Parameters
string

The name of the variable to grab.

split

The string that separates the levels of the variable.

owner

The object to grab the variable from.

Return Value

The variable.

Examples
Basic Usage
PHP
<?php
require 'suit.class.php';
require 'templating.class.php';
$suit = new SUIT();
$templating = new Templating($suit);
$templating->var->dict = array
(
    'foo' => 'bar'
);
$foo = $templating->getvariable('dict.foo', '.', $templating->var);
// Result: 'bar'
?>
Python
from rulebox import templating
templating.var.dict = {
    'foo': 'bar'
}
foo = templating.getvariable('dict.foo', '.', templating.var)
# Result: 'bar'