easeappphp/ea-router

EARouter 是一个简单的请求路由器,它使用纯多维数组形式的路由来处理基于 PHP 的 Web 应用程序和 Web 服务实现中的静态和动态路由。

1.0.8 2023-09-06 04:20 UTC

This package is auto-updated.

Last update: 2024-09-06 06:31:59 UTC


README

EARouter 是一个简单的请求路由器,它使用纯多维数组形式的路由来处理基于 PHP 的 Web 应用程序和 Web 服务实现中的静态和动态路由。

入门指南

使用 Composer,运行

composer require easeappphp/ea-router:^1.0.8

示例路由

# 登录 REST API 路由

'rest-login' => [
	'route_value' => '/rest/login',
	'auth_check_requirements' => 'pre-login',
	'page_filename' => 'rest-login.php',
	'redirect_to' => '',
	'route_type' => 'rest-web-service',
	'allowed_request_methods' => ['POST'],
			'controller_type' => 'procedural',
			'controller_class_name' => \EaseAppPHP\EABlueprint\App\Http\Controllers\ProceduralController::class,
			'method_name' => 'webHtmlOutput',
			'with_middleware' => '',
			'without_middleware' => ''
],

# 我的个人资料 REST API 路由

'rest-get-all-user-details' => [
	'route_value' => '/rest/all-user-details/get',
	'auth_check_requirements' => 'none',
	'page_filename' => 'rest-all-user-details-get.php',
	'redirect_to' => '',
	'route_type' => 'rest-web-service',
	'allowed_request_methods' => ['POST'],
			'controller_type' => 'oop-mapped',
			'controller_class_name' => \EaseAppPHP\EABlueprint\App\Http\Controllers\AllUserDetails\GetController::class,
			'method_name' => 'index',
			'with_middleware' => '',
			'without_middleware' => ''
],

许可证

本软件根据 MIT 许可证分发。请阅读 LICENSE 了解软件的可获得性和分发信息。