RAD Framework
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