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
Coding Style Guidelines
Trongate doesn’t wrap PHP in conventions, or abstractions. It is PHP - raw, fast, and unapologetic. This is Native PHP: code that runs like it was written by someone who actually loves the language.
Core Principles
- Zero bloat. Zero abstraction.
- Write PHP exactly as the creators of the language intended.
- If it doesn’t make your code faster or clearer, it doesn’t belong.
The overwhelming majority of PHP’s built-in functions use snake_case. So should you.
Why Snake Case Wins
- The overwhelming majority of PHP's core functions use snake_case, including :
- Snake case eliminates the eternal
userIdvsuserIDvsUserIdholy wars. - Snake case reads naturally:
get_user_by_id()>getUserByID().
array_merge()class_exists()file_get_contents()function_exists()str_replace()strip_tags()Many PHP frameworks encourage the usage of camelCase. Unfortunately, camelCase introduces unnecessary ambiguity. Consider the following example, which compares camelCase PHP with Native PHP:
No debate. No style-guide meetings. Just simple code.
K&R Style - Because C Got It Right
PHP was built with the C programming language. We honor that. All official examples use Kernighan & Ritchie bracing:
- Four spaces. No tabs. Ever.
- Opening brace on same line.
- Closing brace aligns with the command.
The Only Rules That Matter
- Consistency beats dogma.
- Clarity beats cleverness.
- Speed beats ceremony.
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.