Skip to content

Instantly share code, notes, and snippets.

@Vinai
Last active October 17, 2023 05:38
Show Gist options
  • Star 41 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save Vinai/eb4713bda65fb8b467b1 to your computer and use it in GitHub Desktop.
Save Vinai/eb4713bda65fb8b467b1 to your computer and use it in GitHub Desktop.
My current Magento 2 PHPStorm File Templates (Feb 2016)
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
</resource>
</resources>
</acl>
</config>
{
"name": "${COMPOSER_NAME}",
"description": "${DESCRIPTION}",
"require": {
"php": "~7.1.0|~7.2.0"
},
"type": "magento2-module",
"license": [
"BSD-3-Clause"
],
"autoload": {
"files": [ "registration.php" ],
"psr-4": {
"${NAMESPACE}\\\\${MODULE_NAME}\\": ""
}
}
}
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="${EVENT_NAME}">
<observer name="${OBSERVER_NAME}" instance="${OBSERVER_CLASS}" shared="false"/>
</event>
</config>
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
</body>
</page>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="${MODULE_NAME}" setup_version="0.0.1">
</module>
</config>
<?php
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, '${MODULE_NAME}', __DIR__);
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="#if (${Route_Id} != '')${Route_Id}#else${Front_Name}#end" frontName="#if (${Front_Name} != '')${Front_Name}#else${Route_Id}#end">
<module name="${Module_Name}" />
</route>
</router>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
</system>
</config>
<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
</routes>
@WinstonN
Copy link

Thank you so much for this Vinai! <3

@weverson83
Copy link

👏 👏 👏

@Vinai
Copy link
Author

Vinai commented Mar 31, 2020

OMG, this is soooo old. I'm no longer using these templates, they have evolved a bit since then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment