« Back to the index
\core\WATemplate path example
The table with an alternate template and special lines templates:
{{title}}
@@data:template3:status@@
Lets extract some specific data with a specific path:
??data>6:oneproject??
Or directly the elements:
ID:
{{data>5>id}}
Name:
{{data>5>name}}
Status:
{{data>5>statusname}}
[[template3.key.6]]
{{id}} | {{name}} | {{statusname}} |
[[]]
[[template3.sel.3]]
{{id}} | {{name}} | {{statusname}} |
[[]]
[[template3.loop]]
{{id}} | {{name}} | {{statusname}} |
[[]]
[[template3.loopalt]]
{{id}} | {{name}} | {{statusname}} |
[[]]
[[oneproject]]
ID:
{{id}}
Name:
{{name}}
Status:
{{statusname}}
[[]]
EOF;
$data = array(
'title' => 'Hotels projects:',
'data' => array(
1 => array('id' => 1, 'name' => 'Paris', 'status' => 1, 'statusname' => 'In project'),
2 => array('id' => 2, 'name' => 'London', 'status' => 1, 'statusname' => 'In project'),
3 => array('id' => 3, 'name' => 'Madrid', 'status' => 2, 'statusname' => 'In construction'),
4 => array('id' => 4, 'name' => 'New York', 'status' => 3, 'statusname' => 'Finished'),
5 => array('id' => 5, 'name' => 'Los Angeles', 'status' => 1, 'statusname' => 'In project'),
6 => array('id' => 6, 'name' => 'Mexico City', 'status' => 1, 'statusname' => 'In project'),
7 => array('id' => 7, 'name' => 'Moscu', 'status' => 1, 'statusname' => 'In project'),
8 => array('id' => 8, 'name' => 'Roma', 'status' => 1, 'statusname' => 'In project'),
9 => array('id' => 9, 'name' => 'Berlin', 'status' => 3, 'statusname' => 'Finished'),
)
);
$temp = new \core\WATemplate($template);
$temp->metaElements($data, false, true);
print $temp;
?>
« Back to the index