本文整理汇总了PHP中smarty::setcompiledir方法的典型用法代码示例。如果您正苦于以下问题:PHP smarty::setcompiledir方法的具体用法?PHP smarty::setcompiledir怎么用?PHP smarty::setcompiledir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smarty
的用法示例。
在下文中一共展示了smarty::setcompiledir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty
public function smarty()
{
$smarty = new smarty();
//实例化smarty
$smarty->settemplatedir(BASE_PATH . '/views/default/');
//设置模板文件存放目录
$smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/');
//设置生成文件存放目录
$smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/');
//设置缓存文件存放目录
$this->smarty = $smarty;
return $smarty;
}
示例2: genHtml
/**
* @param $template
* @param $ary
* @return mixed
*/
public static function genHtml($template, $ary)
{
$smarty = new smarty();
$smarty->settemplatedir(BASE_PATH . '/resources/email/');
$smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/');
$smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/');
// add config
$smarty->assign('config', Config::getPublicConfig());
$smarty->assign('analyticsCode', DbConfig::get('analytics-code'));
foreach ($ary as $key => $value) {
$smarty->assign($key, $value);
}
return $smarty->fetch($template);
}
示例3: newSmarty
public static function newSmarty()
{
$smarty = new smarty();
//实例化smarty
$smarty->settemplatedir(BASE_PATH . '/resources/views/' . Config::get('theme') . '/');
//设置模板文件存放目录
$smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/');
//设置生成文件存放目录
$smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/');
//设置缓存文件存放目录
// add config
$smarty->assign('config', Config::getPublicConfig());
$smarty->assign('user', Auth::getUser());
return $smarty;
}
示例4: smarty
public function smarty()
{
global $config;
$smarty = new smarty();
//实例化smarty
$smarty->settemplatedir(BASE_PATH . '/views/' . $config['theme'] . '/');
//设置模板文件存放目录
$smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/');
//设置生成文件存放目录
$smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/');
//设置缓存文件存放目录
// add config
$smarty->assign('config', $config);
$smarty->assign('user', Auth::getUser());
$this->smarty = $smarty;
return $smarty;
}
示例5: setrawcookie
}
if ($_COOKIE["templates"] === "AdminLTE-2") {
$templates_dir = "AdminLTE-2";
} else {
$templates_dir = "materialize";
setrawcookie("templates", $templates_dir, time() + 3600 * 24 * 365, "/");
}
} else {
$templates_dir = "materialize";
setrawcookie("templates", $templates_dir, time() + 3600 * 24 * 365, "/");
}
$smarty = new smarty();
//实例化smarty
$smarty->settemplatedir(__ROOT__ . "templates/" . $templates_dir);
//设置模板文件存放目录
$smarty->setcompiledir(__ROOT__ . "templates_c/" . $templates_dir);
//设置生成文件存放目录
$smarty->setcachedir(__ROOT__ . "cache/" . $templates_dir);
//设置缓存文件存放目录
// 设置模板资源(css/js/font/png/gif...)目录
// $smarty->assign('resources_dir',"../templates/".$templates_dir); //程序放在根目录时请选用这个
$smarty->assign('resources_dir', $site_url . "templates/" . $templates_dir);
//程序放在二级以上目录请选用这个,根目录也可以使用。
$public = $site_url . "public";
$smarty->assign('public', $public);
//公共资源目录,用于存放公共使用的js css images fonts
$smarty->addPluginsDir(__ROOT__ . "myPlugins/");
//自定义插件目录
$smarty->left_delimiter = "<{";
//设置左标示符
$smarty->right_delimiter = "}>";