Docs - close
07/31/2010: SUIT 2.0.1 and Rulebox 1.1.0 released.
Available Since: SUIT (2.0.0)
Handle the closing of a rule.
A dict with the following format:
| Key | Description |
|---|---|
| skip | str: The skip rule, if opened. |
| tree | list: The contents of the tree with the appended data. |
<?php
require 'suit.class.php';
require 'templating.class.php';
$suit = new SUIT();
$templating = new Templating($suit);
tree = array
(
array
(
'contents' => array(),
'rule' => '[var]'
)
);
$pop = array_pop(tree);
$result = $suit->close($templating->rules, 'username', $pop, $tree);
/*
Result: array
(
'skip' => false,
'tree' => array
(
array
(
'contents' => array('username'),
'rule' => '[var]'
)
)
)
*/
?>
import suit
from rulebox import templating # easy_install rulebox
tree = [
{
'contents': [],
'rule': '[var]'
}
]
pop = tree.pop()
result = suit.close(templating.rules, 'username', pop, tree)
# Result: {
# 'skip': False,
# 'tree':
# [
# {
# 'contents': ['username'],
# 'rule': '[var]'
# }
# ]
# }





