Skip to content

Repository files navigation

Katherine — Lightweight PHP Framework

Overview

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.

Key Concepts

  • Routing: Define routes in src/Routes/Routes.php that 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.php which bootstraps the app and dispatches requests.

Repository Structure

  • public/ — Document root (contains index.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.

Installation

  1. Install project dependencies with Composer (if not already present):
composer install
  1. 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

Usage

  • Edit or add routes in src/Routes/Routes.php and 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.

Development Notes

  • Code style: tools/php-cs-fixer/bin/php-cs-fixer is 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.

Contributing

Contributions are welcome. Open an issue or submit a PR describing your change and rationale.

License

This project does not include an explicit license file. Add one if you plan to share the code publicly.

Where to look next

  • Entry point: public/index.php
  • Routes: src/Routes/Routes.php
  • Main controller example: src/Controller/MainController.php

About

Light weight PHP framework

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages