Trongate PHP Framework Docs
Introduction
Quick Start
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
Form Validation
Working With Files
Image Manipulation
Working With Dates & Times
Language Control
Security
Tips And Best Practices

Form Helper Reference

Quick reference for all form helper functions in Trongate.

Form Tags

Function Parameters Returns
$location, $attributes Opening <form> tag
$location, $attributes Opening <form enctype="multipart/form-data">
None CSRF token + </form> tag

Examples

Text Input Fields

Function Type Parameters
text $name, $value, $attributes
email $name, $value, $attributes
password $name, $value, $attributes
number $name, $value, $attributes
search $name, $value, $attributes
hidden $name, $value, $attributes
file $name, $attributes

Examples

Date and Time Input Fields

Function Type Format Parameters
date YYYY-MM-DD $name, $value, $attributes
time HH:MM $name, $value, $attributes
datetime-local YYYY-MM-DDTHH:MM $name, $value, $attributes
month YYYY-MM $name, $value, $attributes
week YYYY-W## $name, $value, $attributes

For additional guidance, check out the chapter on Working With Dates & Times

Examples

Native HTML5 Inputs: Date and time functions use browser-native pickers. Values are always submitted in ISO 8601 format regardless of how the browser displays them to the user.

Textarea and Dropdown

Function Parameters Returns
$name, $value, $attributes <textarea> element
$name, $options, $selected, $attributes <select> element

Examples

Checkboxes and Radio Buttons

Function Parameters Returns
$name, $value, $checked, $attributes <input type="checkbox">
$name, $value, $checked, $attributes <input type="radio">

Examples

Labels and Buttons

Function Parameters Returns
$label_text, $attributes <label> element
$name, $value, $attributes <button type="submit">
$name, $value, $attributes <button> element

Examples

Data Retrieval

Function Parameters Returns
$field, $clean_up, $cast_numeric Field value, array, or empty string

Examples

Validation Error Display

Function Parameters Returns
$first_arg, $closing_html HTML error messages or JSON

Examples

Common Attribute Examples

All Input Types

Number Inputs

Date and Time Inputs

Textareas

Forms

Complete Form Example

All form helpers automatically escape attribute values for XSS protection.

We're continually improving the Trongate documentation. If anything is incorrect, unclear, incomplete, or could be better, we'd genuinely appreciate your input.

Share your thoughts in the Documentation Feedback.

Leave Feedback About This Page