Katherine is a small, lightweight PHP framework used in this workspace to structure a minimal web application. It provides a simple request/response flow, routing helpers, controllers, and view rendering suitable for small projects, demos, and learning purposes.
- Routing: Define routes in
src/Routes/Routes.phpthat map URIs to controller actions. - Controllers: Place request handlers in
src/Controller/(example:MainController.php). - Views: Simple PHP templates are stored in
src/Views/(example:about.php). - Front Controller: Public-facing entry point is
public/index.phpwhich bootstraps the app and dispatches requests.
public/— Document root (containsindex.php).src/Controller/— Controller classes handling requests.src/Routes/— Route definitions and registration.src/Views/— PHP view templates.vendor/— Dependencies installed via Composer.tools/php-cs-fixer/— Local copy of PHP-CS-Fixer used for formatting.
- Install project dependencies with Composer (if not already present):
composer install
- Ensure your web server document root is set to the
public/directory or use the built-in PHP server for development:
php -S localhost:8000 -t public
- Edit or add routes in
src/Routes/Routes.phpand map them to controller methods. - Create controller classes under
src/Controller/and return rendered views or responses. - Place view templates in
src/Views/and include them from controllers.
- Code style:
tools/php-cs-fixer/bin/php-cs-fixeris available to format PHP code. - Autoloading is configured via Composer's
vendor/autoload.php. - The framework intentionally keeps dependencies minimal to remain easy to read and modify.
Contributions are welcome. Open an issue or submit a PR describing your change and rationale.
This project does not include an explicit license file. Add one if you plan to share the code publicly.
- Entry point:
public/index.php - Routes:
src/Routes/Routes.php - Main controller example:
src/Controller/MainController.php