1. Go to this page and download the library: Download shayvmo/webman-annotations library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
declare (strict_types=1);
namespace App\third\controller;
use Shayvmo\WebmanAnnotations\Annotations\RestController;
use Shayvmo\WebmanAnnotations\Annotations\DeleteMapping;
use Shayvmo\WebmanAnnotations\Annotations\GetMapping;
use Shayvmo\WebmanAnnotations\Annotations\Middleware;
use Shayvmo\WebmanAnnotations\Annotations\PostMapping;
use Shayvmo\WebmanAnnotations\Annotations\PutMapping;
use Shayvmo\WebmanAnnotations\Annotations\RequestMapping;
use Shayvmo\WebmanAnnotations\Annotations\ResourceMapping;
use App\third\middleware\SignatureCheck;
use support\Request;
use Tinywan\LimitTraffic\Middleware\LimitTrafficMiddleware;
/**
* @RestController("/test")
* @ResourceMapping("/dddd", allow_methods={"index", "show"})
* @Middleware(SignatureCheck::class)
*/
class ATest
{
public function index()
{
//
return 'Test/index';
}
public function show(Request $request, $id)
{
return "Test/show $id";
}
/**
* @GetMapping("/test")
* @Middleware(SignatureCheck::class)
*/
public function get()
{
return 'Test/get';
}
/**
* @RequestMapping(methods={"get", "post"}, path="/test1")
* @Middleware({
* LimitTrafficMiddleware::class,
* })
*/
public function test()
{
return 'Test/test';
}
/**
* @PostMapping("/post")
*/
public function post()
{
return 'Test/post';
}
/**
* @PutMapping("/put")
*/
public function put()
{
return 'Test/put';
}
/**
* @DeleteMapping("/delete")
*/
public function delete()
{
return 'Test/delete';
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.