rad/rad-framework

Rapid Application Development Framework.


Keywords
framework, php, psr, rad, rad-framework, wip
License
MIT

Documentation

RAD Framework

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require Maintainability

What is RAD?

RAD Framework is for Rapid Application Development Framework.

Why create this?

I wanted to make a basic framework to learn and keep it as simple as possible.

Feel free to use it.

Any advice is welcome.

Installation

PHP 7.4+ and Composer are required.

To get the latest version of RAD Framework, simply add the following line to the require block of your composer.json file:

"rad/rad-framework": "dev-master"

TODO

  • Documentation

Usage

Init New Rad Object :

<?php

require(__DIR__ . "/../vendor/autoload.php");

$app = new \Rad\Rad(__DIR__ . "/config/");

...

Create new Controller :

<?php

class Exemple extends \Rad\Controller\Controller {
    
    /**
     * @get /
     * @produce html
     */
    public function html(ServerRequestInterface $request, ResponseInterface $response, array $args): ResponseInterface {
        $response->getBody()->write("<b>Hello World</b>");
        return $response;
    }

}

Add controller to the Rad API :

$app->addControllers([
    Example:class
]);

Run the Rad API :

$app->run();

You can add Closure to the run method :

$app->run(function(){
	echo "End";
});

How is works

  • Config

  • Middleware

  • Route

  • Controller

PSR Support

  • psr-3 Logger Interface
  • psr-4 Autoloader
  • psr-7 Http Message (Thanks to Guzzle Http)
  • psr-11 Container
  • psr-14 EventDispatcher (WIP Remplace Observer Pattern)
  • psr-15 Middleware (WIP)
  • psr-16 Caching
  • psr-17 Http Factory (Thanks to Guzzle Http)