Download the PHP package donchev/framework without Composer
On this page you can find all versions of the php package donchev/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package framework
Tiny Framework
A lightweight and expressive PHP framework built for clarity, structure, and extensibility. Ideal for small to mid-sized web applications.
Features
Built-in functionalities
- Dependency Injection Container (PHP-DI)
- Routing (FastRoute)
- Middleware support
- Templating with Twig
- Flash messages
- Database support via MeekroDB
- SMTP mailer (Nette Mail)
- Console commands (Symfony Console)
- Caching (Symfony Cache)
- Logging (donchev/simple-logger)
- Data validation and sanitization
Includes Bootstrap 5 and Bootstrap Icons for UI development.
Requirements
- PHP 8.2 or higher
Installation
You can install the framework using Composer.
Configuration
All application configuration is located in config/settings.yaml
. Example:
Override values via settings.local.yaml
.
Usage
Routing
Define routes in config/routes.php
:
Controllers
Controllers extend AbstractController
:
Sending Emails
Database (MeekroDB)
Using Cache
Flash Messages
Set flash messages in controller:
Render them in Twig:
Middleware
Implement MiddlewareInterface
and drop your class into src/Middleware
. It will be auto-loaded.
Twig Template Globals
Twig templates automatically have access to:
http_get
,http_post
,http_cookie
,http_session
settings
get_flash()
function
Data Validator & Sanitizer
Validator:
Validator & Flash Messages:
Sanitizer:
Console Commands
Define commands in bin/console
. Example:
Run them:
Code Style
This project uses php-cs-fixer. You can format your code using:
Check for issues without modifying files:
Testing
The framework includes PHPUnit 12+ test coverage out of the box.
Run tests:
All test files are located in the tests/
folder and follow PSR-4 autoloading with the Tests\
namespace.
Development Mode
Set app.env: dev
to enable detailed error pages (via Whoops) and debugging tools.
Production
Set app.env: prod
to enable compiled container and cache.
License
This project is open-source and licensed under the MIT License.
Author
Developed by Donchev. Contributions are welcome.
All versions of framework with dependencies
ext-json Version *
nikic/fast-route Version ^1.3
php-di/php-di Version ^7.0
symfony/yaml Version ^7.2
donchev/simple-logger Version ^2.1
doctrine/annotations Version ^2.0
twig/twig Version ^3.20
symfony/cache Version ^7.2
nette/mail Version ^4.0
sergeytsalkov/meekrodb Version ^3.1
symfony/console Version ^7.2
laminas/laminas-diactoros Version ^3.5
psr/http-message Version ^2.0