Framework Docs Introduction

Introduction

Wojo Framework is a PHP 8.4 MVC framework with a built-in UI component library. This reference covers the core classes that power every application built on it — from routing and controllers to database access and session management.

Project Structure

The canonical directory layout after installation:

project-root/
├── assets/           Static assets (CSS, JS, images)
├── config/           Configuration files (db.php, general.php, …)
├── language/         Translation JSON files
├── library/
│   ├── Auth/         Authentication classes
│   ├── Controller/
│   │   └── Front/    Front-end controllers
│   │   └── Admin/    Admin-end controllers
│   ├── Core/         Framework core classes
│   └── Database/     PDO query builder
├── routes/
│   └── front.php     Front-end route definitions
│   └── admin.php     Admin-end route definitions
└── view/
    └── front/
        └── themes/
            └── master/  Templates, CSS, JS
    └── admin/
         

Request Lifecycle

Every HTTP request follows this path:

  1. index.php — entry point; defines _WOJO guard constant and includes bootstrap
  2. bootstrap.php — loads config, sets up the App container, registers services (Session, Database, View, …)
  3. routes/front.php — registers URL patterns to controller methods via $router
  4. Router matches the URL, resolves the controller via the App container, and calls the method
  5. Controller method sets $tpl->template and assigns view variables
  6. View::render() outputs header.tpl.php + the assigned template + footer.tpl.php

Key Constants

Constant Description
SITEURL Absolute base URL of the site (e.g. https://example.com/)
BASEPATH Absolute filesystem path to the project root
THEMEURL URL to the active theme directory
THEMEBASE Filesystem path to the active theme directory
VERSION Current framework version string
DEBUG true in development — enables the debug panel and detailed error output
INSTALL_KEY Unique installation key used as the session namespace prefix
DB_SERVER, DB_DATABASE, … Database connection constants defined in config/db.php