gephart/annotation

Gephart Annotation Component

0.5 2017-10-02 16:16 UTC

This package is not auto-updated.

Last update: 2024-03-17 21:08:25 UTC


README

php

Dependencies

  • PHP >= 7.1

Instalation

composer require gephart/annotation

Using

@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"]