aguilardc/moggie
Composer 安装命令:
composer require aguilardc/moggie
包简介
Moggie PHP Micro Framework. A php micro framework recommended to create bare bones API applications
README 文档
README
About
Moggie PHP is a lightweight, syntax elegant web micro-framework.
Requirements
Moggie PHP requires PHP 8.1 or greater.
Installation
1. Download the files.
If you're using Composer, you can run the following command:
composer require aguilardc/moggie
OR you can download them directly and extract them to your web directory.
Routing
Routing in Moggie PHP is done by matching a URL pattern with a callback function.
Route::get('/', function () { echo "Hello world!"; });
Named Parameters
You can specify named parameters in your routes which will be passed along to your callback function.
Route::get('/users/:name/:id', function($name, $id){ echo "hello, $name ($id)!"; });
Working with controllers
You can specify the name of a controller and the method to execute as a string.
the controller name must be separated from the action name with an @.
Route::get('/users', 'UsersController@read'); Route::get('/users/:id', 'UsersController@readById'); Route::post('/users', 'UsersController@create'); Route::put('/users/:id', 'UsersController@update'); Route::delete('/users/:id', 'UsersController@delete');
You can make use of static methods like GET, POST, PUT and DELETE
Note: The controller must be created in the /src/controllers directory and the called function must exist within it.
Security Vulnerabilities
If you discover a security vulnerability within Moggie PHP, please send an e-mail to Nevison Aguilar via aguilardc1105@gmail.com. All security vulnerabilities will be promptly addressed.
License
The Moggie PHP micro-framework is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-17