Hello
I want to use XSLT as the templates since is a wide use standard.
I expanded the Loader class but from some readon is not load the XSLT file:
<?php
class MY_Loader extends CI_Loader {
function xslt($path, $data, $return = false) {
// Load the XML source
$content = $this->_ci_load(array('_ci_path' => $path, '_ci_return' => true));
if(!$content) {
return false;
}
$xml = new DOMDocument;
$xml->load($data);
$xsl = new DOMDocument;
$xsl->load($xslt);
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
$result = trim($proc->transformToDoc($xml)->firstChild->wholeText);
if($return) {
return $result;
} else {
echo $result;
}
}
}
?>
