File tree 8 files changed +81
-0
lines changed
8 files changed +81
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ This way Namespaces and vendor will be automatically filled in.
23
23
24
24
Available templates:
25
25
* ** M2 class** : Default M2 php class.
26
+ * ** M2 class - Backend Controller** : PHP class that extends AbstractAction.
26
27
* ** M2 class - Block** : PHP class that extends Template class.
27
28
* ** M2 class - Helper** : PHP class that extends AbstractHelper
28
29
* ** M2 class - Observer** : PHP class that implements ObserverInterface
@@ -70,6 +71,13 @@ Available commands:
70
71
* ** m2divirtual** : Create an virtual type
71
72
* ** m2dipreference** : Create an preference(rewrite)
72
73
74
+ ## M2 Events
75
+ Available templates:
76
+ * ** M2 Events** : Create an events file.
77
+
78
+ Available commands:
79
+ * ** m2eventobserver** : Create an observer
80
+
73
81
## M2 Extension Attribute
74
82
Available templates:
75
83
* ** M2 Extension Attributes XML** : Create an extension attribute file with default structure.
@@ -78,6 +86,13 @@ Available templates:
78
86
Available templates:
79
87
* ** M2 Layout XML** : Create an layout XML with default structure
80
88
89
+ ## M2 Menu
90
+ Available templates:
91
+ * ** M2 Menu XML** : Create an layout XML with default structure
92
+
93
+ Available commands:
94
+ * ** m2menuadd** : Create an menu tag
95
+
81
96
## M2 Module
82
97
Available templates:
83
98
* ** M2 Module XML** : Create an module XML file that has default structure
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ At this moment there have been live templates created for:
19
19
* ACL
20
20
* DB Schema
21
21
* DI
22
+ * Events
23
+ * Menu
22
24
* Module
23
25
* Phtml (WIP)
24
26
* Registration
@@ -32,17 +34,21 @@ These can be enabled and disabled for if you want to use them or not. If no phps
32
34
At this moment there have been templates created for:
33
35
* ACL
34
36
* Class
37
+ * Class - Backend Controller
35
38
* Class - Block
36
39
* Class - Helper
37
40
* Class - Observer
38
41
* Class - ViewModel
39
42
* Config
40
43
* DB Schema
41
44
* DI
45
+ * Events
42
46
* Extension Attributes
43
47
* Layout
48
+ * Menu
44
49
* Module
45
50
* Registration
51
+ * Routes
46
52
* Sales
47
53
* System
48
54
* System Include
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+ #parse("M2-PHP-File-Header")
3
+
4
+ #if (${NAMESPACE})
5
+ namespace $ {NAMESPACE };
6
+ #end
7
+
8
+ use Magento \Backend \App \AbstractAction ;
9
+
10
+ class $ {NAME } extends AbstractAction
11
+ {
12
+ /**
13
+ *
14
+ */
15
+ public function execute ()
16
+ {
17
+ #[[$ END $ ]]#
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ #parse("M2-XML-File-Header")
3
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:Event/etc/events.xsd" >
4
+ #[[$END$]]#
5
+ </config >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ #parse("M2-XML-File-Header")
3
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Backend:etc/menu.xsd" >
4
+ <menu >
5
+ #[[$END$]]#
6
+ </menu >
7
+ </config >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ #parse("M2-XML-File-Header")
3
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:App/etc/routes.xsd" >
4
+ #[[$END$]]#
5
+ </config >
Original file line number Diff line number Diff line change
1
+ <templateSet group =" M2-events" >
2
+ <template name =" m2eventobserver" value =" < event name=" $eventName$"> < observer name=" $observerName$" instance=" $observerClass$" /> < /event> $END$" description =" create an observer on event" toReformat =" false" toShortenFQNames =" true" >
3
+ <variable name =" eventName" expression =" " defaultValue =" " alwaysStopAt =" true" />
4
+ <variable name =" observerName" expression =" " defaultValue =" " alwaysStopAt =" true" />
5
+ <variable name =" observerClass" expression =" " defaultValue =" " alwaysStopAt =" true" />
6
+ <context >
7
+ <option name =" XML_TEXT" value =" true" />
8
+ </context >
9
+ </template >
10
+ </templateSet >
Original file line number Diff line number Diff line change
1
+ <templateSet group =" M2-menu" >
2
+ <template name =" m2menuadd" value =" < add id=" $menuId$" title=" $title$" translate=" title" module=" $module$" sortOrder=" $order$" parent=" $parentMenuId$" action=" $controllerPath$" resource=" $resourceId$" /> " description =" Add new menu" toReformat =" false" toShortenFQNames =" true" >
3
+ <variable name =" menuId" expression =" " defaultValue =" " alwaysStopAt =" true" />
4
+ <variable name =" title" expression =" " defaultValue =" " alwaysStopAt =" true" />
5
+ <variable name =" module" expression =" " defaultValue =" " alwaysStopAt =" true" />
6
+ <variable name =" order" expression =" " defaultValue =" " alwaysStopAt =" true" />
7
+ <variable name =" parentMenuId" expression =" " defaultValue =" " alwaysStopAt =" true" />
8
+ <variable name =" controllerPath" expression =" " defaultValue =" " alwaysStopAt =" true" />
9
+ <variable name =" resourceId" expression =" " defaultValue =" " alwaysStopAt =" true" />
10
+ <context >
11
+ <option name =" XML_TEXT" value =" true" />
12
+ </context >
13
+ </template >
14
+ </templateSet >
You can’t perform that action at this time.
0 commit comments