Skip to content

Instantly share code, notes, and snippets.

@sugarHoge
Created August 17, 2013 04:37
Show Gist options
  • Save sugarHoge/6255283 to your computer and use it in GitHub Desktop.
Save sugarHoge/6255283 to your computer and use it in GitHub Desktop.
入力フォームなどで、確認画面を用意する際に、前のページから送信されたpostデータからそのままhidden要素を生成
{foreach from=$smarty.post|smarty:nodefaults key="key" item="item"}
{if is_array($item)}
{foreach from=$item key="key2" item="item2"}
<input type="hidden" name="{$key}[{$key2}]" value="{$item2}" />
{/foreach}
{else}
<input type="hidden" name="{$key}" value="{$item}" />
{/if}
{/foreach}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment