Example #1
0
 function fetch($tpl_file, $cache_id = null, $compile_id = null, $display = false)
 {
     if ($this->layout) {
         $this->assign("TEMPLATE_CONTENT", $tpl_file);
         return parent::fetch("layouts/{$this->layout}.tpl", $cache_id, $compile_id, $display);
     }
     return parent::fetch($tpl_file, $cache_id, $compile_id, $display);
 }
Example #2
0
            $this->trigger_error("compile_string_template: missing 'templatestring' parameter");
            return;
        }
        if ($templatestring == '') {
            return "";
        }
        $this->_compile_source("string template", $templatestring, $source);
        //Dump compiled version in output buffer
        ob_start();
        eval('?>' . $source);
        $evaled = ob_get_contents();
        ob_end_clean();
        return $evaled;
    }
}
$smarty = new Smarty2();
session_start();
/*if ( $_POST['form_action'] == 'submit' )
{
    printf_r($_POST);
    foreach( $_POST as $key=>$post_item )
    {
        echo("<br> $key=$post_item");
        if ( $key != 'form_action' && !is_array($post_item) )
            $_SESSION[$key] = $post_item;
    }
}*/
if ($_POST['form_action'] == 'submit') {
    //printf_r($_POST);
    foreach ($_POST as $key => $post_item) {
        //echo("<br> $key=$post_item");