本文整理匯總了PHP中tpl::obj方法的典型用法代碼示例。如果您正苦於以下問題:PHP tpl::obj方法的具體用法?PHP tpl::obj怎麽用?PHP tpl::obj使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tpl
的用法示例。
在下文中一共展示了tpl::obj方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInstance
public static function getInstance($var)
{
if (empty($var) || isset($var['type']) && $var['type'] == 'smarty') {
include FIREZP_PATH . 'driver/tpl/smarty/Smarty.class.php';
$smarty = new Smarty();
$theme = isset($var['theme']) ? $var['theme'] : 'default';
$cache = isset($var['cache']) ? $var['cache'] : false;
$cachetime = isset($var['cachetime']) ? $var['cachetime'] : 3600;
$left_delimiter = isset($var['left_delimiter']) ? $var['left_delimiter'] : '{';
$right_delimiter = isset($var['right_delimiter']) ? $var['right_delimiter'] : '}';
$smarty->template_dir = APP_PATH . 'view/' . $theme . '/';
$smarty->compile_dir = APP_PATH . 'runtime/temp/';
$smarty->cache_dir = APP_PATH . 'runtime/cache/tpl/';
$smarty->caching = $cache;
$smarty->cache_lifetime = $cachetime;
$smarty->left_delimiter = $left_delimiter;
$smarty->right_delimiter = $right_delimiter;
self::$obj = $smarty;
} else {
//擴展
}
return self::$obj;
}