phphleb / radjax
HLEB 微型框架的 Ajax 和 API 路由器
dev-master
2022-05-23 18:20 UTC
Requires
- php: >=7.0.0
- ext-json: *
This package is auto-updated.
Last update: 2024-09-25 07:58:49 UTC
README
Radjax 不包含在框架 HLEB 的原始配置中,因此必须将其复制到 github.com/phphleb/radjax 存储库中的 vendor/phphleb 库文件夹,或使用 Composer 安装
$ composer require phphleb/radjax
在 /routes/radjax.php 中的项目连接(有优先级)
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]);
与 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();