Introduction
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
- Form Handling Fundamentals
- Creating Forms
- Form Input Fields
- Textareas and Dropdowns
- Checkboxes and Radio Buttons
- Form Labels
- Retrieving Form Data
- Form Validation Basics
- Displaying Validation Errors
- The Create/Update Pattern
- CSRF Protection
- Custom Validation Rules
- Form Helper Reference
- Validation Rules Quick Reference
- Best Practices For Handling Data
Working With Files
Image Manipulation
Working With Dates & Times
Authorization & Authentication
Using Debug Mode
The db module ships with a built-in Debug Mode.
Flip one switch → raw SQL dumps straight to your screen. No logs. No var_dump hell. Just the truth.
Enable It. Own It.
- Open
modules/db/Db.php - Find
private $debug = false; - Make it
true
Done. Every query now screams at you.
What You’ll See
Run any $this->db method → a big yellow box appears before your normal output, showing the exact SQL before PDO binds the parameters.
Real Example
Let’s say you have this controller method:
Visit the URL → here’s what happens:
Debug OFF
You only see the nicely formatted JSON (thanks to json()):
Debug ON
First you get the yellow debug box:
-> SELECT * FROM users ORDER BY id
…then, immediately after, the exact same pretty JSON as before.
json() doesn’t care that Debug Mode is on - it still outputs the data perfectly.
Pro tip: In API methods, use json($data, true) to dump the JSON and stop the script instantly. Debug Mode will still show the SQL first - perfect for troubleshooting.
Why This Rules
- See every query before it runs.
- No log files. No external tools. No nonsense.
- Works with all db methods.
- Turn it off in production → one line → gone.
Never ship with $debug = true unless you enjoy giving away your schema for free.