static protected function renderSmarty($webpage, $tplAttributes = Array())
    {
        $smarty = TemplateHelper::getSmartyTemplate();

        $viewOutput = $webpage->outputAttrs();
        foreach ($viewOutput as $k => $v) {
            $smarty->assign($k, $v);
        }
        // render the formobj attributes
        $smarty->assign("view", $viewOutput);

        //Translate Array of template variables to \Zend template object
        foreach ($tplAttributes as $key => $value) {
            $smarty->assign($key, $value);
        }
        
        self::registerSmartyPlugin($smarty);
        
        //if ($webpage->consoleOutput) {
            $smarty->display(TemplateHelper::getTplFileWithPath($webpage->templateFile, $webpage->package));
        //} else {
        //    return $smarty->fetch(TemplateHelper::getTplFileWithPath($webpage->templateFile, $webpage->package));
        //}
    }