The Trongate PHP Framework
Documentation
Introduction
Quick Start
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
Best Practices

Help Improve Our Docs

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 Flashdata Helper

Trongate supports 'flashdata'. Flashdata is session data that will only be available for the next request, before being automatically removed. This can be useful for one-time informational messages (for example: 'The record was successfully created').

To Set Flashdata

Flashdata can be set using the set_flashdata() function, like so:

This is assuming that you have a message which, in this instance, has been assigned to a $msg variable. For example.

Of course, you can save a line of code by passing your message directly into your flashdata declaration. For example:

Displaying Flashdata

Flashdata can be displayed by calling flashdata() from within a view file.

By default, flashdata messages will be displayed as green text within a paragraph. However, you can change the format of your flashdata by adding optional opening and closing tags as arguments. For example:

Below is an example of a view file that contains the flashdata() method.

screenshot
Screenshot form a text editor, demonstrating flashdata being added below page headline.
×