メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

Hidden

Output hidden inputs

Description​

{{ hidden }}

Prints an <input type="hidden"> for every value set with $this->setHidden() in the controller. Names and values are HTML-escaped. Array values become one input per element (tags[0], tags[1] …).

Put it inside the <form>. It is typically used to carry an ID or a one-time ticket from the input screen to the confirmation and save steps.

See also Application::setHidden.

Example​

Controller
$this->setHidden('internal_id', 12);
Template
<form method="post" action="{{ base }}/contact/confirm/">
{{ hidden }}
<button type="submit">Send</button>
</form>
Output
<form method="post" action="/contact/confirm/">
<input type="hidden" name="internal_id" value="12">
<button type="submit">Send</button>
</form>