# Style & Conventions
- Follow CodeIgniter 4 conventions and PSR-12: PascalCase classes (`ProductsModel`), filenames matching class names, camelCase methods/variables, and UPPER_SNAKE_CASE constants.
- Namespaces reflect folder paths (`App\Controllers`, `App\Models`, `Config`). Always import external classes explicitly; avoid inline FQCNs.
- Indentation uses tabs or 4 spaces; no trailing whitespace; single blank line between methods; spaces around operators; no space between function names and parentheses.
- Prefer Query Builder or parameterized queries; escape user input and use `$this->request->getVar()/getPost()` for input. Validate before processing using `$this->validate($rules)`.
- Controllers extend `BaseController`; models extend `CodeIgniter\Model` with `$table`, `$primaryKey`, `$allowedFields`, `$useSoftDeletes`, `$useTimestamps` as needed.
- Views reside in `app/Views`; data is passed as arrays. Use short arrays and align multi-line arrays.
- Control structures always use braces; prefer ternary expressions for simple assignments; keep methods under ~100 lines and avoid deep nesting.
