We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0196219 commit 9ce708eCopy full SHA for 9ce708e
1 file changed
README.md
@@ -3,4 +3,39 @@
3
4
如果你项目模板很多,难于维护,可以使用此工具添加(例如全局样式,javascript,广告等等)。
5
6
-只适用 ThinkPHP `6.0`
+只适用 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
36
+use app\Replace;
37
38
+return [
39
+ 'handle' => Replace::class
40
+]
41
0 commit comments