PHP code example of dilsonjlrjr / slim3-annotation

1. Go to this page and download the library: Download dilsonjlrjr/slim3-annotation 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/ */

    

dilsonjlrjr / slim3-annotation example snippets



$pathController = __DIR__ . '/../Controller';

\Slim3\Annotation\Slim3Annotation::create($app, $pathController, '');


/**
 * @Route("/prefix")
 */
class ClassController {

    /**
     * @Get(name="/rota2/{id}", alias="rote.id")
     */
    public function method() {
    }
}


/**
 * @Get(name="/rota2", alias="rote.id")
 */
public function method() {
}


/**
 * @Post(name="/rota2/{id}", alias="rote.id")
 */
public function method() {
}


/**
 * @Put(name="/rota2/{id}", alias="rote.id")
 */
public function method() {
}


/**
 * @Put(name="/rota2/{id}", alias="rote.id")
 */
public function method() {
}


/**
 * @Route("/prefix")
 */
class ClassController {

    /**
     * @Get(name="/rota2/{id}", alias="rote.id")
     */
    public function method() {
    }
}


/*
 * @Get(name="/rota2", alias="rote.id", middleware={"Test\Middleware\ExampleMiddleware"})
 */
public function method() {
}

/**
 * @Get(name="/rota3", alias="rote.id", middleware={"Test\Middleware\ValidateMiddleware", "Test\Middleware\ExampleMiddleware"})
 */
public function method() {
}