skyline/route-annotation-compiler

v0.8.2 2020-12-12 15:04 UTC

This package is auto-updated.

Last update: 2021-10-12 16:58:14 UTC


README

Adding this package to your Skyline Application extends its compilation to read routing information directly from the annotations of action controllers.

class MyActionController extends AbstractActionController {
    /**
     * My first action
     * 
     * @route literal /direct-uri-to-this-action 
     * @route regex %^/my\-(1|2|3)\-action$%i 
     *
     * @render html-render
     */
    public function myAction() {
        // ...
    }
}

The @route annotation declares how to reach this action. Using literal or regex to describe a request URI. You must declare at least a URI annotation.

Additional declare a specific render to use.

Putting annotations into class doc comment makes it valid for all actions inside the class.