- PHP >= 7.4
composer require gephart/annotation
@AnnotationName value @AnnotationName {"or anything":"in JSON"}
/**
* @Route /home/
*/
class SuperClass
{
/**
* @Template {
* "url": "index.html"
* }
*/
public function index()
{
}
}
$reader = new \Gephart\Annotation\Reader();
$annotation = $reader->get("Route", SuperClass::class);
// /home/
$annotation = $reader->get("Template", SuperClass::class, "index);
// ["url"=>"index.html"]