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

Changing Color Schemes

The built-in admin template ships with multiple color schemes (default, blue, red, green) and switching between them is ridiculously simple.

How It Works

Just add a theme key to your $data array:

That’s it. One line.

What Happens Behind the Scenes

In modules/templates/Templates.php the admin() method does this:

Then inside modules/templates/views/admin.php you will find:

The result: the <body> tag gets class="theme-blue", class="theme-red", etc.

The Built-In Themes

The default admin.css already contains these ready-to-use themes:

  • default – dark charcoal (the original look)
  • blue
  • red
  • green

Creating Your Own Theme

Want purple, orange, or a high-contrast mode? Just add a new CSS block to modules/templates/css/admin.css:

Then use it exactly the same way:

No registration. No config files. No recompiling.

Per-User Themes (Real-World Example)

Why This Rules

One line of PHP + one CSS block = instant theme switch.

That’s the Trongate way!

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