Skip to content

Commit a582e62

Browse files
committed
added routes, events, module
1 parent 32c6e96 commit a582e62

File tree

6 files changed

+122
-2
lines changed

6 files changed

+122
-2
lines changed

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,38 @@
5353
{
5454
"language": "xml",
5555
"path": "./snippets/layout/update.json"
56+
},
57+
{
58+
"language": "xml",
59+
"path": "./snippets/di/preference.json"
60+
},
61+
{
62+
"language": "xml",
63+
"path": "./snippets/di/scaffold.json"
64+
},
65+
{
66+
"language": "xml",
67+
"path": "./snippets/di/type.json"
68+
},
69+
{
70+
"language": "xml",
71+
"path": "./snippets/di/virtualtype.json"
72+
},
73+
{
74+
"language": "xml",
75+
"path": "./snippets/module/module.json"
76+
},
77+
{
78+
"language": "php",
79+
"path": "./snippets/module/registration.json"
80+
},
81+
{
82+
"language": "xml",
83+
"path": "./snippets/events.json"
84+
},
85+
{
86+
"language": "xml",
87+
"path": "./snippets/routes.json"
5688
}
5789
]
5890
}

snippets/di/scaffold.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"prefix": "m2.di",
44
"body": [
55
"<?xml version=\"1.0\"?>",
6-
"<page xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager/etc/config.xsd\">",
6+
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ",
7+
"\t\txsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager/etc/config.xsd\">",
78
"\t$0",
8-
"</page>"
9+
"</config>"
910
],
1011
"description": "Magento 2 DI scaffold"
1112
}

snippets/events.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Events Scaffold": {
3+
"prefix": "m2.events",
4+
"body": [
5+
"<?xml version=\"1.0\"?>",
6+
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
7+
"\t\txsi:noNamespaceSchemaLocation=\"urn:magento:framework:Event/etc/events.xsd\">",
8+
"\t$0",
9+
"</config>"
10+
],
11+
"description": "Magento 2 events scaffold"
12+
},
13+
"Event": {
14+
"prefix": "m2.events.event",
15+
"body": [
16+
"<event name=\"${1:event_name}\">",
17+
"\t$0",
18+
"</event>"
19+
],
20+
"description": "Magento 2 event"
21+
},
22+
"Observer": {
23+
"prefix": "m2.events.observer",
24+
"body": [
25+
"<observer name=\"${1:observer_name}\"",
26+
"\tinstance=\"${2:Fully Qualified Classname}\" />"
27+
],
28+
"description": "Magento 2 event observer"
29+
}
30+
}

snippets/module/module.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"Module": {
3+
"prefix": "m2.module",
4+
"body": [
5+
"<?xml version=\"1.0\"?>",
6+
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ",
7+
"\t\txsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager/etc/module.xsd\">",
8+
"\t<module name=\"${1:Vendor_Module}\" setup_version=\"0.1.0\" />",
9+
"</config>"
10+
],
11+
"description": "Magento 2 DI scaffold"
12+
}
13+
}

snippets/module/registration.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"Registration": {
3+
"prefix": "m2.module.registration",
4+
"body": [
5+
"\\Magento\\Framework\\Component\\ComponentRegistrar::register(",
6+
"\t\\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,",
7+
"\t'${1:Vendor_Module}',",
8+
"\t__DIR__",
9+
");"
10+
],
11+
"description": "Magento 2 registration file"
12+
}
13+
}

snippets/routes.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"Routes Scaffold": {
3+
"prefix": "m2.routes",
4+
"body": [
5+
"<?xml version=\"1.0\"?>",
6+
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
7+
"\t\txsi:noNamespaceSchemaLocation=\"urn:magento:framework:App/etc/routes.xsd\">",
8+
"\t$0",
9+
"</config>"
10+
],
11+
"description": "Magento 2 routes scaffold"
12+
},
13+
"Router": {
14+
"prefix": "m2.routes.router",
15+
"body": [
16+
"<router id=\"${2|admin,standard|}\">",
17+
"\t$0",
18+
"</router>"
19+
],
20+
"description": "Magento 2 event"
21+
},
22+
"Route": {
23+
"prefix": "m2.routes.route",
24+
"body": [
25+
"<route id=\"${1:route_id}\" frontName=\"${2:frontname}\">",
26+
"\t<module name=\"${3:Vendor_Module}\" />",
27+
"</route>"
28+
],
29+
"description": "Magento 2 event observer"
30+
}
31+
}

0 commit comments

Comments
 (0)