-
Notifications
You must be signed in to change notification settings - Fork 48
more features
Inhere edited this page Jan 15, 2019
·
3 revisions
相信在前面的文档中已经看到过类似:
@usage {command} [arg ...] [--opt ...]
OR
@usage {fullCommand} [arg ...] [--opt ...]
其中的 {command}
{fullCommand}
就是可替换变量,在渲染时,会被自动替换为对应的值。
- 方式一
protected function annotationVars(): array
{
return \array_merge(parent::annotationVars(), [
'myVar' => 'value',
]);
}
- 方式二
在 init 方法里,调用 addAnnotationVar
protected function init()
{
parent::init();
$this->addAnnotationVar('myVar', 'value');
}
我的其他PHP项目
- inhere/kite 方便本地开发和使用的个人CLI工具应用
- php-toolkit/pflag PHP编写的,通用的命令行标志(选项和参数)解析库
- phppkg/easytpl 使用简单且快速的 PHP 模板引擎
- inhere/php-validate 一个简洁小巧且功能完善的php验证库
- inhere/sroute 轻量且快速的HTTP请求路由库