Download the PHP package jacksonsr45/radiante-php without Composer
On this page you can find all versions of the php package jacksonsr45/radiante-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jacksonsr45/radiante-php
More information about jacksonsr45/radiante-php
Files in jacksonsr45/radiante-php
Package radiante-php
Short Description This is a simple micro-framework in PHP
License MIT
Informations about the package radiante-php
RadiantPHP Microframework
RadiantPHP is a lightweight microframework for building PHP web applications. It provides a simple and elegant structure to develop web projects with ease. With RadiantPHP, you can quickly build RESTful APIs, web services, or small to medium-sized websites.
The RadiantPHP ServerRequestFactory provides a simple and convenient way to handle HTTP requests and responses in your PHP application. This documentation will guide you on how to integrate the ServerRequestFactory into your index.php
file to handle incoming requests and send appropriate responses.
Installation
In you project php, opem your terminal and enter with this commands!
Usage
Follow the steps below to integrate the RadiantPHP ServerRequestFactory into your index.php
file:
-
Import the required class:
-
Include the Composer autoloader and set the path to your
routes.php
file: -
Create the ServerRequest and handle the request:
- Send the HTTP response:
Example:
Here's a complete example of how your index.php
file should look after integrating the RadiantPHP ServerRequestFactory:
Make sure to replace '../vendor/autoload.php'
with the correct path to your Composer autoloader if it differs.
Routes:
Create routes easiling with methods [GET
, PUT
, DELETE
, PUT
], first stape is using instance with class Route
another using method
, in method is required string to route path
and a array with Controller::class
and class method
.
Create a route GET
:
Create a route POST
:
Create a route DELETE
Create a route PUT
Creating Controller:
By creating a new controller is simple, build a new class and in this class if is required using a DI create a __contruct()
, and in inject a interface.
By functionalit is required in index.php
include is partial code:
And in controller is required:
With these simple steps, you have successfully integrated the RadiantPHP ServerRequestFactory into your index.php file, allowing you to handle incoming HTTP requests and send appropriate responses in your PHP application.