# Simple Framework A lightweight PHP framework with clean routing and template management. ## Features - **Simple Routing**: Clean URLs through `index.php` (e.g., `/index.php/about`) - **Template System**: Organized template files with reusable header/footer - **Output Buffering**: Templates can set variables that are used in header/footer - **Configuration Management**: Centralized constants in `assets/config.php` - **No Dependencies**: Pure PHP, no external libraries required ## Structure ``` / âââ assets/ â âââ config.php # Site configuration and constants â âââ css/ â â âââ style.css # Main stylesheet â âââ js/ â âââ main.js # Main JavaScript âââ includes/ â âââ header.php # Site header â âââ footer.php # Site footer âââ templates/ â âââ home.php # Home page template â âââ about.php # About page template â âââ contact.php # Contact page template âââ index.php # Bootstrap/Router âââ README.md ``` ## How It Works 1. **index.php** receives all requests and parses the URL 2. It determines which template to load from `PAGE_TEMPLATES` in config 3. The template file is loaded with `ob_start()` to buffer output 4. Templates can set variables like `$pageTitle`, `$pageDescription`, `$additionalHead`, etc. 5. The header is rendered (with access to template variables) 6. The buffered template content is output 7. The footer is rendered ## Configuration Edit `assets/config.php` to customize: - `SITE_NAME` - Your site name - `SITE_URL` - Your site URL - `PAGE_TEMPLATES` - Add/remove pages and their settings ## Adding New Pages 1. Add a new entry to `PAGE_TEMPLATES` in `assets/config.php`: ```php 'services' => [ 'file' => 'services.php', 'title' => 'Services' ] ``` 2. Create the template file in `templates/services.php` 3. The page will automatically appear in the navigation ## Template Variables Templates can set these variables to customize the output: - `$pageTitle` - Page title (appears in `
This content will be wrapped by header and footer.