template_dir ); $this->tal= new PHPTal(); } /** * A function which outputs the result of a transposed * template to the output stream * * @param template Name of template to display */ public function display( $template ) { $this->tal->setTemplate( $this->template_dir . $template . '.html' ); try { echo $this->tal->execute(); } catch (Exception $e){ echo $e; } } /** * A function which returns the content of the transposed * template as a string * * @param template Name of template to fetch */ public function fetch( $template ) { $this->tal->setTemplate( $this->template_dir . $template . '.html' ); try { return $this->tal->execute(); } catch (Exception $e){ return $e; } } /** * Assigns a variable to the template engine for use in * constructing the template's output. * * @param key name( s ) of variable * @param value value of variable */ public function assign( $key, $value= '' ) { $this->tal->set( $key, $value ); } /** * Appends to an existing variable more values * * @param key name of variable * @param value value of variable */ public function append( $key, $value= '' ) { $this->tal->set( $key, $value ); } } ?>