├── .gitattributes
├── .github
└── FUNDING.yml
├── CHANGELOG.md
├── README.md
└── templates
└── Magento.xml
/.gitattributes:
--------------------------------------------------------------------------------
1 | /docs export-ignore
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: markshust
4 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All notable changes to this project will be documented in this file.
3 |
4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6 |
7 | ## [Unreleased]
8 |
9 | N/A
10 |
11 | ## [1.4.0] - 2021-01-28
12 |
13 | ### Added
14 | - Added `declare(strict_types=1);` to PHP templates.
15 | - Added `translate="title"` to XML templates where appropriate.
16 |
17 | ### Updated
18 | - Fixed inconsistent indentation with some XML templates.
19 |
20 | ## [1.3.2] - 2020-10-11
21 |
22 | ### Removed
23 | - Removed parent from being added to submenu id (unneeded) in `magentoMenuXml` template.
24 |
25 | ## [1.3.1] - 2020-10-11
26 |
27 | ### Updated
28 | - Simplified attributes within `magentoMenuXml` template.
29 |
30 | ## [1.3.0] - 2020-10-11
31 |
32 | ### Added
33 | - Added `magentoAclXml` for acl.xml.
34 |
35 | ## [1.2.0] - 2020-10-06
36 |
37 | ### Added
38 | - Added `magentoMenuXml` for menu.xml.
39 |
40 | ## [1.1.0] - 2020-09-04
41 |
42 | ### Added
43 | - Added `magentoCspXml` for csp_whitelist.xml.
44 |
45 | ## [1.0.0] - 2020-03-27
46 |
47 | ### Added
48 | - Initial release.
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
ABANDONED!
3 |
4 |
THIS PROJECT IS NO LONGER MAINTAINED
5 |
6 |
7 | You are free to continue using these live templates, but this project is abandoned and no longer maintained.
8 |
9 |
10 | ---
11 |
12 |
markshust/phpstorm-magento-live-templates
13 |
14 |
15 |
PHPStorm Live Templates for Magento 2
16 |
17 |
18 |
19 |
20 | ## Table of contents
21 |
22 | - [Installation](#installation)
23 | - [Usage](#usage)
24 | - [Contributing](#contributing)
25 | - [Free Course](#free-course)
26 | - [License](#license)
27 |
28 | ## Installation ⚠️
29 |
30 | > Until the PHPStorm issue [IDEA-184753](https://youtrack.jetbrains.com/issue/IDEA-184753) is resolved, the normal installation process for read-only repositories will not work.
31 |
32 | > Instead, you will need to install this collection of templates manually. You can do this by getting your configuration directory from [https://www.jetbrains.com/help/idea/tuning-the-ide.html](https://www.jetbrains.com/help/idea/tuning-the-ide.html?_ga=2.20256752.917962769.1596218809-1712783055.1595617792#config-directory), then symlinking the Magento.xml template into it's template directory.
33 |
34 | > For example on a Mac you would:
35 |
36 | ```
37 | # clone out the repo
38 | git clone git@github.com:markshust/phpstorm-magento-live-templates.git ~/Sites/phpstorm-magento-live-templates
39 |
40 | # setup a symlink to the template within the templates directory
41 | # ln -s ~/Sites/phpstorm-magento-live-templates/templates/Magento.xml ~/Library/Application\ Support/JetBrains//templates/Magento.xml
42 |
43 | # for example, PHPStorm 2020.2:
44 | mkdir ~/Library/Application\ Support/JetBrains/PhpStorm2020.2/templates/
45 | ln -s ~/Sites/phpstorm-magento-live-templates/templates/Magento.xml ~/Library/Application\ Support/JetBrains/PhpStorm2020.2/templates/Magento.xml
46 | ```
47 |
48 | > After restarting PHPStorm, the live templates should then show up at Preferences > Editor > Live Templates > Magento.
49 |
50 | > Please upvote the issue at [IDEA-184753](https://youtrack.jetbrains.com/issue/IDEA-184753) and show your support for it in a comment, so the following steps can be used instead once it is resolved:
51 |
52 | 1. In PHPStorm, Go to Preferences > Tools > Settings Repository
53 | 2. Add a new Read-only Source with the URL: https://github.com/markshust/phpstorm-magento-live-templates
54 | 3. Restart PHPStorm
55 |
56 | ## Usage
57 |
58 | With a file open, start typing the live template abbreviation. If a lot of other autocompletes show up, tap the up arrow (live template abbreviations appear last).
59 |
60 | ### Available live templates
61 |
62 | - `magentoAclXml`: template for acl.xml
63 | - `magentoConfigClassPreferenceXml`: template for class preference within config XML
64 | - `magentoConfigPluginXml`: template for plugin within config XML
65 | - `magentoCspXml`: template for csp_whitelist.xml
66 | - `magentoDiXml`: template for di.xml
67 | - `magentoEventXml`: template for event.xml
68 | - `magentoLayoutsXml`: template for layouts.xml
69 | - `magentoLayoutViewModelXml`: template for view model within layout XML
70 | - `magentoLayoutXml`: template for layout.xml
71 | - `magentoMenuXml`: template for menu.xml
72 | - `magentoModuleXml`: template for module.xml
73 | - `magentoRegistrationPhp`: template for registration.php
74 | - `magentoRoutesXml`: template for routes.xml
75 | - `magentoWebapiXml`: template for webapi.xml
76 |
77 | ## Contributing
78 |
79 | 1. [Find the PHPStorm configuration directory](https://www.jetbrains.com/help/phpstorm/tuning-the-ide.html?_ga=2.80029911.1780511293.1585231724-1306045097.1582457949&keymap=secondary_default_for_macos#config-directory) for your operating system
80 | 2. Inside that directory is a `templates` directory
81 | 3. You can clone this repo out to this directory and submit edits to the `Magento.xml` file
82 |
83 | All live templates are to be suffixed with either `Xml` or `Php` depending on the scope. This is to avoid confusion since a lot of templates will be created over time.
84 |
85 | ## Free Course
86 |
87 | This course is sponsored by M.academy. Level up your Magento 2 skills with a collection of resources including lessons, courses & more.
88 |
89 |
90 |
91 | If you find this repo useful, you may enjoy the following course to learn more about relatively unknown tips, tricks & improvements for PHPStorm:
92 |
93 |
94 |
95 |
96 | Obscure PHPStorm Hacks
97 |
98 |
99 | ## License
100 |
101 | [MIT](https://opensource.org/licenses/MIT)
102 |
--------------------------------------------------------------------------------
/templates/Magento.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------