Trongate PHP Framework Docs
Introduction
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
Authorization & Authentication
Tips And Best Practices

Using the Language Module

The Language module is designed to be used via direct object access.

No need to load services or initialize objects.

Just call the method.


Example: Validation Module

Load language data like this:

That's it.


Using the Data

Once loaded, use the array as needed:

Simple array access. No wrappers.


Fallback Behaviour

If the file does not exist:

  • An empty array is returned
  • Your code continues without interruption

This allows you to implement your own fallback logic if required.


Getting the Current Language

You can retrieve the current language at any time:


Decoupled by Design

  • Module methods provide access
  • Modules contain logic
  • Your code remains clean and independent

No tight coupling. No enforced structure.