skyline/route-annotation-compiler

v8.0.0 2023-02-07 21:25 UTC

This package is auto-updated.

Last update: 2024-04-08 00:03:05 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.