Skip to content

Commit 9ce708e

Browse files
committed
update
1 parent 0196219 commit 9ce708e

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,39 @@
33

44
如果你项目模板很多,难于维护,可以使用此工具添加(例如全局样式,javascript,广告等等)。
55

6-
只适用 ThinkPHP `6.0`
6+
只适用 ThinkPHP `6.0`
7+
8+
## 安装
9+
```sh
10+
$ composer require xiaodi/think-templte-magic:dev-master
11+
```
12+
13+
## 使用
14+
例子 添加一个`css`样式
15+
```php
16+
<?php
17+
18+
namespace app;
19+
20+
use xiaodi\Contracts\TemplateMagicHandleInterface;
21+
use xiaodi\Contracts\TemplateMagicReplaceInterface;
22+
23+
class Replace implements TemplateMagicHandleInterface
24+
{
25+
public function handle(TemplateMagicReplaceInterface $handle)
26+
{
27+
$handle->head('<link rel="stylesheet" href="https://static.kodcloud.com/index/js/lib/bootstrap-3.3.7/css/bootstrap.min.css">');
28+
}
29+
}
30+
31+
```
32+
33+
### 配置
34+
`config/template_magic.php`
35+
```php
36+
use app\Replace;
37+
38+
return [
39+
'handle' => Replace::class
40+
]
41+
```

0 commit comments

Comments
 (0)