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

Regarding Table Names

Every method in the db module expects the table name as a plain old PHP string.

No guessing. No magic. No URL-segment autodetection. You pass it.

If you're coming from v1: table names were optional there. In v2 they're mandatory. Every time. This isn't a bug - it's clarity.


Example

Here's a controller method that fetches records and renders a page:

The table name is right there, second argument to . No guessing, no surprises.

SQL executed

Same deal with every method

The table is always explicit. Always the last parameter (or second-last, if there's an options array). Always required.

This means you can call the same method from any controller and target any table. No URL manipulation tricks. No routes to break. Just rock-solid, explicit code.

Write the table name. Every single time.

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