Trongate PHP Framework Docs
Introduction
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
Working With Files
Image Manipulation
Working With Dates & Times
Authorization & Authentication
Tips And Best Practices

Additional Includes

Every page has its own toys. A dashboard wants charts. A profile page wants an image cropper. A blog post wants syntax highlighting. With additional includes you give each page exactly what it needs – nothing more, nothing less.

From Any Controller

Just add two optional arrays to your $data:

What Happens Behind the Scenes

The Templates module automatically turns those arrays into proper HTML:

Anything ending in .css becomes →

Anything ending in .js becomes →

Full URLs or raw HTML strings → inserted exactly as written

Here are the two lines you will find in every template file:

The ?? '' simply prevents errors when no extra files are declared.

Real-World Examples

Loading from a CDN

Loading assets from any module (using the module assets trigger)

Passing raw HTML when you need special attributes

Conditional loading

Why This Rules

  • Only the pages that need the assets actually load them.
  • No more 2 MB of JavaScript on the login screen.
  • No more unused CSS slowing down your site.