1. Go to this page and download the library: Download littler/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/ */
littler / annotation example snippets
namespace app\controller;
use littler\Inject;
use littler\Route;
use littler\route\Group;
use littler\route\Middleware;
use littler\route\Resource;
use think\Cache;
use think\middleware\SessionInit;
/**
* Class IndexController
* @package app\controller
* @Group("bb")
* @Resource("aa")
* @Middleware({SessionInit::class})
*/
class IndexController
{
/**
* @Inject()
* @var Cache
*/
protected $cache;
public function index()
{
//...
}
/**
* @Route("xx")
*/
public function xx()
{
//...
}
}