Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drmvc/framework
Simple and flexible PHP MVC framework
https://github.com/drmvc/framework
dependency-injection framework mvc psr-11
Last synced: about 2 months ago
JSON representation
Simple and flexible PHP MVC framework
- Host: GitHub
- URL: https://github.com/drmvc/framework
- Owner: drmvc
- License: mit
- Created: 2015-12-15T01:52:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-26T07:27:35.000Z (over 6 years ago)
- Last Synced: 2024-08-06T17:07:15.097Z (5 months ago)
- Topics: dependency-injection, framework, mvc, psr-11
- Language: PHP
- Homepage: https://drmvc.com/
- Size: 891 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Latest Stable Version](https://poser.pugx.org/drmvc/framework/v/stable)](https://packagist.org/packages/drmvc/framework)
[![Build Status](https://travis-ci.org/drmvc/framework.svg?branch=master)](https://travis-ci.org/drmvc/framework)
[![Total Downloads](https://poser.pugx.org/drmvc/framework/downloads)](https://packagist.org/packages/drmvc/framework)
[![License](https://poser.pugx.org/drmvc/framework/license)](https://packagist.org/packages/drmvc/framework)
[![PHP 7 ready](https://php7ready.timesplinter.ch/drmvc/framework/master/badge.svg)](https://travis-ci.org/drmvc/framework)
[![Code Climate](https://codeclimate.com/github/drmvc/framework/badges/gpa.svg)](https://codeclimate.com/github/drmvc/framework)
[![Scrutinizer CQ](https://scrutinizer-ci.com/g/drmvc/framework/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/drmvc/framework/)# DrMVC\Framework
A framework that combines some modules. necessary to create a full-fledged web application.
composer require drmvc/framework
## How to use
More examples you can find [here](extra).
### Example of `index.php` inside `public_html` folder:
```php
load(__DIR__ . '/../app/database.php', 'database');use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;$app = new \DrMVC\App($config);
$app
->get('/', \MyApp\Controllers\Index::class . ':default') //-> public function action_default()
->get('/zzz', \MyApp\Controllers\Index::class) //-> public function action_index()
->get('/zzz/', \MyApp\Controllers\Index::class)
->get('/aaa', function(Request $request, Response $response, $args) {
print_r($args);
});echo $app->run();
```### Example of `Index` controller inside `app/Controllers` folder:
```php
getBody()->write($json);
}public function action_defaultRequest $request, Response $response, $args)
{
$out = [
'test1',
'test2'
];$json = json_encode($out);
header('Content-Type: application/json');
$response->getBody()->write($json);
}
}
```## Where to get help
If you found the bug, please report about this on [GitHub Issues](https://github.com/drmvc/framework/issues) page.
## About PHP Unit Tests
First need to install all dev dependencies via `composer update`, then
you can run tests by hands from source directory via `./vendor/bin/phpunit` command.## Links
* [DrMVC Framework](https://drmvc.com)
* [Slim](https://github.com/slimphp/Slim) - Is a PHP micro framework, I really like how there are implemented the PSR-4 conception.
* [SimpleMVC](https://github.com/simple-mvc-framework/framework) - it was a very exciting project, before the author renamed this to Nova
* [Phalcon](https://github.com/phalcon) - Simple and clean code of your application