Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は変数を持っています
$new = 'cookie_name'
今、私は必要です
$newSmarty テンプレートで Cookie 名として使用
$new
何かのようなもの
{$smarty.cookies.$new}
しかし、うまくいきませんでした
試しました{$smarty.cookies[$new]}か?
{$smarty.cookies[$new]}
編集:今すぐ試してください:{$_COOKIES[$new]}
{$_COOKIES[$new]}
次のように、この変数を smarty に割り当てる必要があります。
$new = "cookie_name"; $smarty->assign("new", $new);
これ$newで smarty テンプレートができました:
{$new} or {$smarty.cookies[$new]}