Last active
July 23, 2018 05:39
-
-
Save cmuench/acf8de3055213da6a61755e942f7214e to your computer and use it in GitHub Desktop.
PHPStorm Live Templates for Magento 2 (copy xml content to clipboard and paste it in a template group)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="magento2:__" value="<?php echo __('$SELECTION$'); ?>" description="Translation" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:collection" value="class Collection extends AbstractCollection { /** * Initialize resource model * * @return void */ protected function _construct() { $this->_init($model$::class, $resourceModel$::class); } }" toReformat="true" toShortenFQNames="true"> | |
<variable name="model" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="resourceModel" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="magento2:console:command" value="<?php namespace $namespace$; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; /** * $description$ */ class $class$Command extends Command { /** * command name */ const COMMAND_NAME = '$name$'; /** * {@inheritdoc} */ protected function configure() { $this->setName(self::COMMAND_NAME) ->setDescription($description$); parent::configure(); } /** * @param InputInterface $input * @param OutputInterface $output * @return int Non zero if invalid type, 0 otherwise */ protected function execute(InputInterface $input, OutputInterface $output) { return 0; } } " toReformat="true" toShortenFQNames="true"> | |
<variable name="namespace" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="description" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="magento2:controller:action" value="namespace $namespace$; use Magento\Framework\App\Action\Action; use Magento\Framework\App\ResponseInterface; class $action$ extends Action { /** * Dispatch request * * @return \Magento\Framework\Controller\\Magento\Framework\Controller\ResultInterface|ResponseInterface * @throws \Magento\Framework\Exception\\Magento\Framework\Exception\NotFoundException */ public function execute() { } }" toReformat="true" toShortenFQNames="true"> | |
<variable name="namespace" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="action" expression="capitalize(String)" defaultValue="Index" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="magento2:setup:table:column:product-id" value="->addColumn( 'product_id', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, ['unsigned' => true, 'nullable' => false], 'Reference to product table' ) ->addForeignKey( $setup->getFkName( '$table$', 'product_id', 'catalog_product_entity', 'entity_id' ), 'product_id', $setup->getTable('catalog_product_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE ) " toReformat="true" toShortenFQNames="true"> | |
<variable name="table" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="magento2:setup:table:column:store-id" value="->addColumn( 'store_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, null, ['unsigned' => true, 'nullable' => false, 'default' => '0'], 'Store ID' ) ->addForeignKey( $installer->getFkName('$table$', 'store_id', 'store', 'store_id'), 'store_id', $installer->getTable('store'), 'store_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )" toReformat="true" toShortenFQNames="true"> | |
<variable name="table" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="magento2:setup:table:price" value="->addColumn( 'price', \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL, '12,4', ['nullable' => false, 'default' => '0.0000'], 'Price Value' )" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="magento2:test:mock:quote" value="$quoteMock = $this->getMockBuilder(CartInterface::class)->getMock();" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="PHP Expression" value="true" /> | |
<option name="PHP Statement" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:test:objectManager" value="$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $var$ = $objectManagerHelper->getObject('$class$', []); /* @var $var$ \$class$ */ " toReformat="true" toShortenFQNames="true"> | |
<variable name="var" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="PHP" value="true" /> | |
<option name="PHP Comment" value="false" /> | |
<option name="PHP String Literal" value="false" /> | |
</context> | |
</template> | |
<template name="magento2:xml:acl" value="<?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="$module$::$resource_name$"> </resource> </resources> </acl> </config> " toReformat="true" toShortenFQNames="true"> | |
<variable name="module" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="resource_name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:acl:store-config" value="<acl> <resources> <resource id="Magento_Backend::admin"> <resource id="Magento_Backend::stores"> <resource id="Magento_Backend::stores_settings"> <resource id="Magento_Config::config"> <resource id="$myid$" title="$mytitle$" translate="title" /> </resource> </resource> </resource> </resource> </resources> </acl>" toReformat="true" toShortenFQNames="true"> | |
<variable name="myid" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="mytitle" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:config" value="<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> </default> </config> " toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="XML" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:crontab" value="<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> </group> </config> " toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:di" value="<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> </config>" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:di:add-command" value="<type name="Magento\Framework\Console\CommandList"> <arguments> <argument name="commands" xsi:type="array"> <item name="$name$Command" xsi:type="object">$class$</item> </argument> </arguments> </type>" toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:di:add-router" value="<type name="Magento\Framework\App\RouterList"> <arguments> <argument name="routerList" xsi:type="array"> <item name="$name$" xsi:type="array"> <item name="class" xsi:type="string">$class$</item> <item name="disable" xsi:type="boolean">false</item> <item name="sortOrder" xsi:type="string">$order$</item> </item> </argument> </arguments> </type>" description="Registrates a router class" toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="order" expression="" defaultValue="50" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:di:secure-url" value="<type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> <item name="$name$" xsi:type="string">/$name$/</item> </argument> </arguments> </type>" toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:email-templates" value="<?xml version="1.0"?> <!-- /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> $cursor$ </config> " toReformat="true" toShortenFQNames="true"> | |
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:events" value="<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> </config>" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:extension-attributes" value="<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> </config> " toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:fieldset" value="<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> </config> " toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:indexer" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> </config> " toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:layout" value="<?xml version="1.0"?> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> </layout>" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="XML" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:menu" value="<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> </config> " toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:module" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="$name$" setup_version="1.0.0"> <sequence> </sequence> </module> </config> " toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:page" value="<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> $cursor$ </page>" toReformat="true" toShortenFQNames="true"> | |
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:page-types" value="<?xml version="1.0"?> <page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> </page_types>" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:product-types" value="<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> </page>" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:routes" value="<?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="$id$" frontName="$frontname$"> <module name="$modulename$" /> </route> </router> </config> " toReformat="true" toShortenFQNames="true"> | |
<variable name="id" expression="decapitalize(String)" defaultValue="" alwaysStopAt="true" /> | |
<variable name="frontname" expression="decapitalize(String)" defaultValue="" alwaysStopAt="true" /> | |
<variable name="modulename" expression="capitalizeAndUnderscore(String)" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:system" value="<?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"> </config>" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:ui:listing" value="<?xml version="1.0" encoding="UTF-8"?> <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> </listing>" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:view" value="<?xml version="1.0" ?> <view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <vars module="$module$"> </vars> </view> " toReformat="true" toShortenFQNames="true"> | |
<variable name="module" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:webapi" value="<?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> " toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:xml:widget" value="<?xml version="1.0" encoding="UTF-8"?> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> </widgets> " toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="XML_TEXT" value="true" /> | |
</context> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment