dom = $dom; $this->layout_name = $layout_name; $this->template_name = $template_name; $this->action_name = $action_name; $this->controller_name = $controller_name; $this->debug = $debug; } public function render(){ $out = null; if( empty($this->layout_name) ){ // we want to try using the default $file = BASE_DIR.APP_DIR.DS.SITE_TEMPLATES.DS."layouts".DS."default".TEMPLATE_EXTN; } else { $file = BASE_DIR.APP_DIR.DS.SITE_TEMPLATES.DS."layouts".DS.$this->layout_name.TEMPLATE_EXTN; } // now see if its actually a file if( is_file($file) ) { // Make a DOMDocument for the xsl file $xsl = new DomDocument(); $xsl->load( $file ); /* create the processor and import the stylesheet */ $proc = new XsltProcessor(); $xsl = $proc->importStylesheet( $xsl ); // prolly want to do this later //$proc->setParameter(null, "titles", "Titles"); ob_start(); $proc->transformToURI($this->dom,'php://output'); $out = ob_get_clean(); /* transform and output the xml document */ //print $newdom->saveXML(); } else { if( $this->debug ) { echo "no such file ".$file; } } echo $out; } public function set_debug() { $this->debug = true; } public function write(){ } } ?>