Introduction
Basic Concepts
Understanding Routing
Controllers
Views
Assets
Modules Calling Modules
Parent & Child Modules
Database Operations
Modules within Modules
Templates & Themes
Helpers Explained
Form Handling
Working with Files
The Module Import Wizard
Authorization & Authentication
The API Explorer
If you’ve found an error, spotted something missing, or feel a section could be clearer or better explained, we’d love to hear from you. Your feedback helps keep the documentation accurate and useful for everyone.
Please report issues or suggest improvements on GitHub. Community input is invaluable in making the docs stronger.
Not comfortable with GitHub? No problem — you can also get in touch with us directly via our contact form. We welcome all feedback.
The File Validation Helper
Trongate is loaded with a variety of features that can assist with the uploading of files such as images. Before exploring Trongate's file validation helper, let's have a reminder of how to draw a file uploader form using Trongate:
The code above could be used to produce a form that looks like this:

Understanding The Uploader Form
The uploader form, above, starts by invoking the form_open_upload() method.
As can see, an argument has been passed into the method. The argument represents the destination for the uploader form. The destination is the URL where the user is sent to when the form is submitted. The opening line produces the following HTML code:
The assumption being made with this example is that an $update_id
variable has been passed into the view file. We're also assuming that the BASE_URL
value is set to:
Next, we invoked Trongate's validation_errors() method.
The validation_errors()
method displays form validation errors, if there are any.
After displaying some text-based instructions, the next important part of our form is:
The form_file_select method displays a form file uploader field. As you can see, the argument 'picture'
has been passed into the method. The 'picture'
argument represents the name of the file uploader form field. The HTML code that gets generated from the form_file_select()
method is shown below:
- name
- attributes
What these two attributes represent and how they behave is identical to how ordinary form_input() methods work. See the Form Helpers API Reference for details.
The 'submit' button has been assigned with a name of 'submit' but the word 'Upload' appears inside the button.
The uploader form is closed by invoking form_close().