Skip to content

Commit

Permalink
修正文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Nov 2, 2023
1 parent 898f22f commit 363e046
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/components/udpServer/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ class Test extends \Imi\Controller\UdpController

```php
// 解析 $data['action'] === 'login'
@TcpRoute({"action"="login"})
@UdpRoute({"action"="login"})
// 解析 $data['a']['b']['c'] === 'login'
@TcpRoute({"a.b.c"="login"})
@UdpRoute({"a.b.c"="login"})
// 解析 $data['a'] == '1' && $data['b'] == '2'
@TcpRoute({"a"="1", "b"="2"})
@UdpRoute({"a"="1", "b"="2"})
```

当然对象也是支持的:

```php
// 解析 $data->a->b->c === 'login'
@TcpRoute({"a.b.c"="login"})
@UdpRoute({"a.b.c"="login"})
```

路由匹配成功,就会执行这个动作。
Expand Down

0 comments on commit 363e046

Please sign in to comment.