skyline/route-annotation-compiler

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

This package is auto-updated.

Last update: 2024-09-08 01:00:49 UTC


README

将此包添加到您的Skyline应用程序中,可以扩展其编译功能,直接从动作控制器的注解中读取路由信息。

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() {
        // ...
    }
}

@route注解声明如何到达此动作。使用字面量或正则表达式描述请求URI。您必须声明至少一个URI注解。

此外,声明要使用的特定渲染。

将注解放入类文档注释中,使其对该类中的所有动作都有效。