Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

路由注解加name属性,在获取route对象时得不到name值 #1202

Closed
burugo opened this issue Jan 13, 2020 · 2 comments
Closed

路由注解加name属性,在获取route对象时得不到name值 #1202

burugo opened this issue Jan 13, 2020 · 2 comments
Assignees

Comments

@burugo
Copy link

burugo commented Jan 13, 2020

Q A
Bug report? yes
Feature request? yes
Swoft version 2.0.7 (by php bin/swoft -V)
Swoole version 4.4.8 (by php --ri swoole)
PHP version 7.3.11 (by php -v)
Runtime environment Win10/Mac/CentOS 7/Ubuntu/Docker etc.

Describe the bug
RequestMapping注解的name属性无效

Details

路由注解加name属性,在获取route对象时得不到name值
打印出来是空字符串
已经提交了pr swoft-cloud/swoft-component#559

Provide minimal script to reproduce the issue

 /**
   *@RequestMapping(method={RequestMethod::GET},name="get.route.test")
   */
public function show(Request $request){
    $route = $request->getAttribute(Request::ROUTER_ATTRIBUTE)[2];
    $routeName = $route->getName();
    vdump($routeName);
}
@inhere
Copy link
Member

inhere commented Jan 13, 2020

hi @burugo

不能直接向组件仓库提交PR, 参考这里 #829

@burugo
Copy link
Author

burugo commented Jan 13, 2020

hi @burugo

不能直接向组件仓库提交PR, 参考这里 #829

已更改pr地址

@burugo burugo closed this as completed Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants