「Php/Smarty/smarty5」の版間の差分
ナビゲーションに移動
検索に移動
編集の要約なし |
|||
| 4行目: | 4行目: | ||
==smarty4から5へ== | ==smarty4から5へ== | ||
===setterへ=== | ===setterへ=== | ||
$smarty-> | 修正前 | ||
<pre> | |||
$smarty->cache_dir = '/path/to/cache'; | |||
$smarty->template_dir = '/path/to/templates'; | |||
$smarty->compile_dir = '/path/to/templates_c'; | |||
$smarty->left_delimiter = '{{'; | |||
$smarty->right_delimiter = '}}'; | |||
</pre> | |||
修正後 | |||
<pre> | <pre> | ||
$ | $smarty->setCacheDir('/path/to/cache'); | ||
$ | $smarty->setTemplateDir('/path/to/templates'); | ||
$ | $smarty->setCompileDir('/path/to/templates_c'); | ||
$smarty->setLeftDelimiter('{{''); | |||
$smarty->setRightDelimiter('}}''); | |||
</pre> | </pre> | ||
===getterへ=== | ===getterへ=== | ||
修正前 | |||
<pre> | |||
$smarty->template_dir; | |||
$smarty->compile_dir; | |||
$smarty->cache_dir; | |||
$smarty->left_delimiter; | |||
$smarty->right_delimiter; | |||
</pre> | |||
修正後 | |||
<pre> | <pre> | ||
$smarty-> | $smarty->getTemplateDir(); | ||
$smarty-> | $smarty->getCompileDir(); | ||
$smarty-> | $smarty->getCacheDir(); | ||
$smarty->getLeftDelimiter(); | |||
$smarty->getRightDelimiter(); | |||
</pre> | </pre> | ||
2026年4月4日 (土) 22:07時点における版
smarty5のダウンロード
https://github.com/smarty-php/smarty/releases/tag/v5.8.0
smarty4から5へ
setterへ
修正前
$smarty->cache_dir = '/path/to/cache';
$smarty->template_dir = '/path/to/templates';
$smarty->compile_dir = '/path/to/templates_c';
$smarty->left_delimiter = '{{';
$smarty->right_delimiter = '}}';
修正後
$smarty->setCacheDir('/path/to/cache');
$smarty->setTemplateDir('/path/to/templates');
$smarty->setCompileDir('/path/to/templates_c');
$smarty->setLeftDelimiter('{{'');
$smarty->setRightDelimiter('}}'');
getterへ
修正前
$smarty->template_dir; $smarty->compile_dir; $smarty->cache_dir; $smarty->left_delimiter; $smarty->right_delimiter;
修正後
$smarty->getTemplateDir(); $smarty->getCompileDir(); $smarty->getCacheDir(); $smarty->getLeftDelimiter(); $smarty->getRightDelimiter();
use必須
new Smartyなどで、Smartyを使ってる箇所に以下を追加
use Smarty\Smarty;