@@ -47,6 +47,48 @@ A nice start to a collection of Magento 2 code snippets for Visual Studio Code!
47
47
</ul >
48
48
</details >
49
49
50
+ ### Modules
51
+ <details >
52
+ <summary ><a href =" #mod-instructions " >Instructions</a ></summary >
53
+ <ul >
54
+ <li><a href="#module-xml">Module XML</a></li>
55
+ <li><a href="#registration-php">Registration</a></li>
56
+ </ul >
57
+ </details >
58
+
59
+ ### DI
60
+ <details >
61
+ <summary ><a href =" #di-instructions " >Instructions</a ></summary >
62
+ <ul >
63
+ <li><a href="#di-scaffold">Scaffold</a></li>
64
+ <li><a href="#preference">Preference</a></li>
65
+ <li><a href="#type">Type</a></li>
66
+ <li><a href="#plugin">Plugin</a></li>
67
+ <li><a href="#virtual-type">Virtual Type</a></li>
68
+ </ul >
69
+ </details >
70
+
71
+ ### Events
72
+ <details >
73
+ <summary ><a href =" #events-instructions " >Instructions</a ></summary >
74
+ <ul >
75
+ <li><a href="#events-scaffold">Scaffold</a></li>
76
+ <li><a href="#event">Event</a></li>
77
+ <li><a href="#observer">Observer</a></li>
78
+ </ul >
79
+ </details >
80
+
81
+ ### Routes
82
+ <details >
83
+ <summary ><a href =" #routes-instructions " >Instructions</a ></summary >
84
+ <ul >
85
+ <li><a href="#routes-scaffold">Scaffold</a></li>
86
+ <li><a href="#routers">Routers</a></li>
87
+ <li><a href="#route">Route</a></li>
88
+ </ul >
89
+ </details >
90
+
91
+
50
92
# Layouts
51
93
52
94
## Instructions
@@ -345,3 +387,200 @@ display=""
345
387
``` xml
346
388
remove=""
347
389
```
390
+
391
+
392
+ # Modules
393
+
394
+ ## Module Instructions
395
+
396
+ ### Module XML
397
+
398
+ ** Trigger:** ` m2.module `
399
+
400
+ ** Output:**
401
+ ``` xml
402
+ <?xml version =" 1.0" ?>
403
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
404
+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/module.xsd" >
405
+ <module name =" " setup_version =" 0.1.0" />
406
+
407
+ </config >
408
+ ```
409
+
410
+ ### Registration
411
+
412
+ ** Trigger:** ` m2.module.registration `
413
+
414
+ ** Output:**
415
+ ``` php
416
+ \Magento\Framework\Component\ComponentRegistrar::register(
417
+ \Magento\Framework\Component\ComponentRegistrar::MODULE,
418
+ '',
419
+ __DIR__
420
+ );
421
+ ```
422
+
423
+
424
+ # DI
425
+
426
+ ## DI Instructions
427
+
428
+ ### DI Scaffold
429
+
430
+ ** Trigger:** ` m2.di `
431
+
432
+ ** Output:**
433
+ ``` xml
434
+ <?xml version =" 1.0" ?>
435
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
436
+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
437
+
438
+ </config >
439
+ ```
440
+
441
+ ### Preference
442
+
443
+ ** Trigger:** ` m2.di.pref `
444
+
445
+ ** Output:**
446
+ ``` xml
447
+ <preference for =" " type =" " />
448
+ ```
449
+
450
+ ### Type
451
+
452
+ ** Trigger:** ` m2.di.type `
453
+
454
+ ** Output:**
455
+ ``` xml
456
+ <type name =" " >
457
+
458
+ </type >
459
+ ```
460
+
461
+ #### Type Arguments
462
+
463
+ ** Trigger:** ` m2.di.type.args `
464
+
465
+ ** Output:**
466
+ ``` xml
467
+ <arguments >
468
+ <argument name =" " xsi : type =" " ></argument >
469
+ </arguments >
470
+ ```
471
+
472
+ #### Type Arguments Item
473
+
474
+ ** Trigger:** ` m2.di.type.args.item `
475
+
476
+ ** Output:**
477
+ ``` xml
478
+ <item name =" " xsi : type =" " ></item >
479
+ ```
480
+
481
+ ### Plugin
482
+
483
+ ** Trigger:** ` m2.di.plugin `
484
+
485
+ ** Output:**
486
+ ``` xml
487
+ <plugin name =" "
488
+ type =" "
489
+ sortOrder =" " />
490
+ ```
491
+
492
+ ### Virtual Type
493
+
494
+ ** Trigger:** ` m2.di.virtualtype `
495
+
496
+ ** Output:**
497
+ ``` xml
498
+ <virtualType name =" " type =" " >
499
+
500
+ </virtualType >
501
+ ```
502
+
503
+
504
+ # Events
505
+
506
+ ## Events Instructions
507
+
508
+ ### Events Scaffold
509
+
510
+ ** Trigger:** ` m2.events `
511
+
512
+ ** Output:**
513
+ ``` xml
514
+ <?xml version =" 1.0" ?>
515
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
516
+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:Event/etc/events.xsd" >
517
+
518
+ </config >
519
+ ```
520
+
521
+
522
+ ### Event
523
+
524
+ ** Trigger:** ` m2.events.event `
525
+
526
+ ** Output:**
527
+ ``` xml
528
+ <event name =" " >
529
+
530
+ </event >
531
+ ```
532
+
533
+
534
+ ### Observer
535
+
536
+ ** Trigger:** ` m2.events.observer `
537
+
538
+ ** Output:**
539
+ ``` xml
540
+ <observer name =" " instance =" " />
541
+ ```
542
+
543
+
544
+ # Routes
545
+
546
+ ## Routes Instructions
547
+
548
+ ### Routes Scaffold
549
+
550
+ ** Trigger:** ` m2.routes `
551
+
552
+ ** Output:**
553
+ ``` xml
554
+ <?xml version =" 1.0" ?>
555
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
556
+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:App/etc/routes.xsd" >
557
+
558
+ </config >
559
+ ```
560
+
561
+
562
+ ### Routers
563
+
564
+ ** Trigger:** ` m2.routes.router `
565
+
566
+ ** Output:**
567
+ ``` xml
568
+ <router id =" " >
569
+
570
+ </router >
571
+ ```
572
+
573
+
574
+ ### Route
575
+
576
+ ** Trigger:** ` m2.routes.route `
577
+
578
+ ** Output:**
579
+ ``` xml
580
+ <route id =" " frontName =" " >
581
+ <module name =" " />
582
+ </route >
583
+ ```
584
+
585
+
586
+
0 commit comments