We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
安装:
composer require smarty/smarty
使用:
<?php //开启调试模式 define('APP_DEBUG', true); //入口文件目录绝对路径 define('SITE_ROOT', str_replace('\\', '/', __DIR__)); //数据缓存目录绝对目录 defined('DATA_PATH') or define('DATA_PATH', SITE_ROOT . '/data'); //包含自动加载类 $loader = require './vendor/autoload.php'; //smarty实例化 $smarty = new \Smarty; //$smarty->left_delimiter = "{#"; //$smarty->right_delimiter = "#}"; $smarty->setTemplateDir(SITE_ROOT . '/views/'); //设置模板目录 $smarty->setCompileDir(SITE_ROOT . '/data/cache/templates_c/'); $smarty->setConfigDir(SITE_ROOT . '/views/smarty_configs/'); $smarty->setCacheDir(SITE_ROOT . '/data/cache/smarty_cache/'); //$smarty->force_compile = true; if (APP_DEBUG) { //$smarty->debugging = true; $smarty->caching = false; $smarty->cache_lifetime = 0; } else { //$smarty->debugging = false; $smarty->caching = true; $smarty->cache_lifetime = 120; } $smarty->assign('title', '标题'); $smarty->display('index.html'); ?>
原文:使用composer安装smarty3.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
安装:
composer require smarty/smarty
使用:
原文:使用composer安装smarty3.1
The text was updated successfully, but these errors were encountered: