Skip to content

Commit 4675515

Browse files
authored
Update README.md
1 parent e2ca202 commit 4675515

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ThinkPHP-Pinyin
2-
ThinkPHP版 中文转拼音扩展包 只支持ThinkPHP6
2+
ThinkPHP版 中文转拼音扩展包 支持ThinkPHP `5.1` `6.0`版本
33

44
## 安装
55
```sh
@@ -43,5 +43,23 @@ Pinyin::sentence();
4343

4444
控制器里 也可以这样写
4545
```php
46-
$this->app->pinyin->convert('带着希望去旅行,比到达终点更美好');
46+
// 5.1
47+
use think\Controller;
48+
49+
class Index extends Controller
50+
{
51+
$this->app->pinyin->convert('带着希望去旅行,比到达终点更美好');
52+
}
53+
54+
```
55+
56+
```php
57+
// 6.0
58+
use app\BaseController
59+
60+
class Index extends BaseController
61+
{
62+
$this->app->pinyin->convert('带着希望去旅行,比到达终点更美好');
63+
}
64+
4765
```

0 commit comments

Comments
 (0)