public static function get($value_DGFSrtfg5, $data_kGdfgdf = null) { $name_fgdfgdf = str_replace('.', '/', $value_DGFSrtfg5); if (!is_null($data_kGdfgdf)) { foreach ($data_kGdfgdf as $key => $value2) { ${$key} = $value2; } } // ob_start(); // start output buffering //get File // $name_fgdfgdf = str_replace('.', '/', $value_DGFSrtfg5); // $link1 = '../app/views/' . $name_fgdfgdf . '.php'; $link2 = '../app/views/' . $name_fgdfgdf . '.tpl.php'; $link3 = ''; // $tpl = false; // if (file_exists($link1)) { $link3 = $link1; $tpl = false; } else { if (file_exists($link2)) { $link3 = $link2; $tpl = true; } else { $link3 = $name_fgdfgdf; $tpl = false; } } // //Show the output if ($tpl) { self::$showed = "tpl"; Templete::show($link3, $data_kGdfgdf); } else { self::$showed = "smpl"; include $link3; } // $returned_value = ob_get_contents(); // get contents from the buffer ob_end_clean(); // return $returned_value; }
public static function ini($root = "") { require_once $root . '../core/Associates/Smarty/Smarty.class.php'; // self::$smarty = new Smarty(); // self::$smarty->force_compile = false; //self::$smarty->debugging = true; //self::$smarty->caching = true; //self::$smarty->cache_lifetime = 120; //Smarty::muteExpectedErrors(); self::$smarty->setTemplateDir('../app/storage/view/compile'); self::$smarty->setCompileDir('../app/storage/view/template'); //self::$smarty->setCacheDir('app/storage/view/cache'); }
public static function ini($root = "") { require_once $root . '../core/Associates/Smarty/Smarty.class.php'; // self::$smarty = new Smarty(); // self::$smarty->compile_check = true; self::$smarty->force_compile = true; self::$smarty->debugging = false; self::$smarty->caching = false; self::$smarty->use_sub_dirs = false; self::$smarty->cache_lifetime = 120; self::$smarty->left_delimiter = '{'; self::$smarty->right_delimiter = '}'; self::$smarty->smarty_debug_id = 'SMARTY_DEBUG'; self::$smarty->clearAllCache(3600); // Smarty::muteExpectedErrors(); self::$smarty->setCompileDir($root . '../app/storage/view/template'); self::$smarty->setCacheDir($root . '../app/storage/view/cache'); self::$smarty->setPluginsDir(array($root . '../app/themes/' . Config::get('themes.name') . '/_plugins', $root . '../core/Associates/Smarty/plugins')); }
public static function get($value_DGFSrtfg5, $data_kGdfgdf = null, $items = null) { if (!is_null($data_kGdfgdf)) { foreach ($data_kGdfgdf as $key => $value2) { ${$key} = $value2; } } if (is_array($value_DGFSrtfg5)) { if ($value_DGFSrtfg5['backend']) { $themename = Config::get('themes.name'); $simpleFile = Config::get('themes.path'); $simpleFile = str_replace('{themeName}', $themename, $simpleFile); $smartyFile = Config::get('themes.path'); $smartyFile = str_replace('{themeName}', $themename, $smartyFile); } else { $themename = Config::get('themes.nameFrontEnd'); //PHP VIEW $simpleFile = Config::get('themes.pathFront'); $simpleFile = str_replace('{themeName}', $themename, $simpleFile); //TPL VIEW $smartyFile = Config::get('themes.pathFront'); $smartyFile = str_replace('{themeName}', $themename, $smartyFile); } ob_start(); // start output buffering //get File $name_fgdfgdf = str_replace('.', '/', $value_DGFSrtfg5['view']); $simpleFile = str_replace('{viewName}', $name_fgdfgdf, $simpleFile); $simpleFile = str_replace('{fileExtention}', "php", $simpleFile); $smartyFile = str_replace('{viewName}', $name_fgdfgdf, $smartyFile); $smartyFile = str_replace('{fileExtention}', "tpl", $smartyFile); $link1 = $simpleFile; $link2 = $smartyFile; $tpl = false; if (file_exists($link1)) { $link3 = $link1; $tpl = false; } else { if (file_exists($link2)) { $link3 = $link2; $tpl = true; } else { $link3 = $name_fgdfgdf; $tpl = false; } } //Show the output if ($tpl) { self::$showed = "tpl"; Templete::show($link3, $data_kGdfgdf, $items); } else { self::$showed = "smpl"; include $link3; } $returned_value = ob_get_contents(); // get contents from the buffer ob_end_clean(); return $returned_value; } else { return false; } }