File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Release Notes for Spacing
2
2
3
- ## 1.0.0
3
+ ## 1.0.1 - 2023-04-26
4
+ - Setup a ` {{ craft.spacing.config }} ` to globally access config values in Twig templates
5
+
6
+ ## 1.0.0 - 2023-04-25
4
7
- Initial release
Original file line number Diff line number Diff line change 2
2
"name" : " trendyminds/craft-spacing" ,
3
3
"description" : " A utility field to insert spacing between your Matrix blocks" ,
4
4
"type" : " craft-plugin" ,
5
- "version" : " 1.0.0 " ,
5
+ "version" : " 1.0.1 " ,
6
6
"license" : " mit" ,
7
7
"support" : {
8
8
"email" : " dev@trendyminds.com" ,
36
36
"yiisoft/yii2-composer" : true ,
37
37
"craftcms/plugin-installer" : true
38
38
}
39
+ },
40
+ "require-dev" : {
41
+ "laravel/pint" : " ^1.5"
39
42
}
40
43
}
Original file line number Diff line number Diff line change 7
7
use craft \events \RegisterComponentTypesEvent ;
8
8
use craft \helpers \Json ;
9
9
use craft \services \Fields ;
10
+ use craft \web \twig \variables \CraftVariable ;
10
11
use Exception ;
11
12
use Illuminate \Support \Collection ;
12
13
use trendyminds \spacing \fields \Field ;
14
+ use trendyminds \spacing \variables \Variable ;
13
15
use yii \base \Event ;
14
16
15
17
/**
@@ -46,6 +48,16 @@ function (RegisterComponentTypesEvent $event) {
46
48
$ event ->types [] = Field::class;
47
49
}
48
50
);
51
+
52
+ Event::on (
53
+ CraftVariable::class,
54
+ CraftVariable::EVENT_INIT ,
55
+ function (Event $ event ) {
56
+ /** @var CraftVariable $variable */
57
+ $ variable = $ event ->sender ;
58
+ $ variable ->set ('spacing ' , Variable::class);
59
+ }
60
+ );
49
61
}
50
62
51
63
public static function options (): Collection
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace trendyminds \spacing \variables ;
4
+
5
+ use Illuminate \Support \Collection ;
6
+ use trendyminds \spacing \Spacing ;
7
+
8
+ class Variable
9
+ {
10
+ public function config (): Collection
11
+ {
12
+ return Spacing::options ();
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments