function contemplate_eval in Content Templates (Contemplate) 6
Same name and namespace in other branches
- 5 contemplate.module \contemplate_eval()
- 7 contemplate.module \contemplate_eval()
Copy of drupal_eval(), but extracts the node object so that variables are available to the template
Parameters
$tmplt: text the template code
$obj: object an object to extract into the local variables
Return value
string executed template code
2 calls to contemplate_eval()
- contemplate_eval_enclosure in ./
contemplate.module - Eval the RSS enclosure field
- contemplate_nodeapi in ./
contemplate.module - Implementation of hook_nodeapi().
File
- ./
contemplate.module, line 831 - Create templates to customize teaser and body content.
Code
function contemplate_eval($tmplt, $obj, &$xml_elements) {
extract((array) $obj);
$node = $obj;
ob_start();
print eval('?>' . $tmplt);
$output = ob_get_contents();
ob_end_clean();
return $output;
}