cs_render — Render a CS parse tree to a string.
string cs_render( | cs); |
resource cs;
Returns the rendered parse tree represented by
cs, or null
if either the render fails or no template data has been added.
Example 25. cs_render example
<?php
$hdf = hdf_init();
hdf_set_value($hdf, 'message', 'Hello World!');
$cs = cs_init($hdf);
$template = 'Your message is "<?cs var message ?>".';
if (!cs_parse_string($cs, $template)) {
die('Failed to parse template');
}
print cs_render($cs);
?>