phphleb / radjax
Ajax- and API-router for Micro-Framework HLEB
dev-master
2022-05-23 18:20 UTC
Requires
- php: >=7.0.0
- ext-json: *
This package is auto-updated.
Last update: 2024-12-25 08:28:05 UTC
README
The Radjax is not included in the original configuration of the framework HLEB, so it must be copied to the folder with the vendor/phphleb libraries from the github.com/phphleb/radjax repository or installed using Composer:
$ composer require phphleb/radjax
Connection to the project in /routes/radjax.php (are priority)
Radjax\Route::get("/info/", ["get"], "App\Controllers\TestController@index", ["protected"=>false]); // and advanced customization Radjax\Route::get("/weather/{y}/{m}/{d}/{h?}/", ["get","post"], "App\Controllers\TestController@weather", ["protected"=>true, "where"=>["y"=>"[0-9]+", "m"=>"[0-9]+", "d"=>"[0-9]+", "h"=>"[0-9]+"], "session_saved" => false]);
Connection separate from HLEB :
// require or through classes autoloader require '/vendor-directory/phphleb/radjax/Route.php'; require '/vendor-directory/phphleb/radjax/Src/RCreator.php'; require '/vendor-directory/phphleb/radjax/Src/App.php'; // Initialization with the path to the route file. // If the route was found, boolean `true` will be returned, else `false`. $isActive = (new Radjax\Src\App(['/path-to-directory/routes/radjax-route.php']))->get();