We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4875d82 commit 13f061fCopy full SHA for 13f061f
1 file changed
README.md
@@ -0,0 +1,38 @@
1
+## usage
2
+
3
+- `composer require eecjimmy/basic`
4
5
+```php
6
+namespace demo;
7
+use eecjimmy\Basic\CacheableTrait;
8
+class Demo
9
+{
10
11
+ use CacheableTrait;
12
13
+ public function getUser()
14
+ {
15
+ return $this->cacheGet(__METHOD__, function () {
16
+ echo "cache missing...\n";
17
+ return 'user';
18
+ });
19
+ }
20
21
+ public static function getStudent()
22
23
+ return self::cacheGetStatic(__METHOD__, function () {
24
25
+ return 'student';
26
27
28
29
+ public function getWithArgument($a)
30
31
+ $key = md5(__METHOD__ . json_encode(func_get_args()));
32
+ return $this->cacheGet($key, function () {
33
34
+ return 'with-argument';
35
36
37
+}
38
+```
0 commit comments