All pastes #992402 Raw Edit

Something

public text v1 · immutable
#992402 ·published 2008-04-21 20:20 UTC
rendered paste body
    public function display()
    {
        /*
        $template = $this->currentAction->getTemplateVars();
        ob_start();
        $res = include 'templates/' . $this->currentAction->getTemplate();
        $html = ob_get_contents();
        ob_end_clean();
        if ( $res === false )
        {
            throw new Exception( 'Template error.' );
        }
        echo $html;
        */

		$template = new ezcTemplate();

        $templateVars = $this->currentAction->getTemplateVars();

		$template->send->object = $templateVars;

		try
		{
			echo $template->process($this->currentAction->getTemplate());
		}
		catch (Exeption $e )
		{
			echo $e->getMessage();
		}
    }


###########################################################


{ use $templateVars }

<title>{$templateVars->title}</title>

{ include 'head.ezt' }

<p>home template ezt</p>

{include 'foot.ezt'}


#############################


ERROR: "The use variable 'templateVars' is not set."