Add templates from other repository
https://github.com/staempfli/magento2-phpstorm-templates
This commit is contained in:
commit
8f21debd83
5
fileTemplates/2M PHTML.phtml
Normal file
5
fileTemplates/2M PHTML.phtml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
#parse("stmpfl_variables.txt")
|
||||
#parse("stmpfl_header_php.php")
|
||||
|
||||
?>
|
3
fileTemplates/2M XML.xml
Normal file
3
fileTemplates/2M XML.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
#parse("stmpfl_variables.txt")
|
||||
#parse("stmpfl_header_xml.xml")
|
||||
|
17
fileTemplates/2M composer.json
Normal file
17
fileTemplates/2M composer.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "${COMPOSER_NAME}",
|
||||
"description": "${DESCRIPTION}",
|
||||
"require": {
|
||||
"php": "~5.6.0|~7.0.0"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"autoload": {
|
||||
"files": [ "registration.php" ],
|
||||
"psr-4": {
|
||||
"${NAMESPACE}\\\\${MODULE_NAME}\\": ""
|
||||
}
|
||||
}
|
||||
}
|
2
fileTemplates/2M js-class.js
Normal file
2
fileTemplates/2M js-class.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
#parse("stmpfl_variables.txt")
|
||||
#parse("stmpfl_header_js.js")
|
6
fileTemplates/2M registration Module.php
Normal file
6
fileTemplates/2M registration Module.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
\Magento\Framework\Component\ComponentRegistrar::register(
|
||||
\Magento\Framework\Component\ComponentRegistrar::MODULE,
|
||||
'${VendorName}_${ModuleName}',
|
||||
__DIR__
|
||||
);
|
6
fileTemplates/includes/stmpfl_header_js.js
Normal file
6
fileTemplates/includes/stmpfl_header_js.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* ${NAME}
|
||||
*
|
||||
* @copyright Copyright © ${YEAR} ${company}. All rights reserved.
|
||||
* @author ${userEmail}
|
||||
*/
|
6
fileTemplates/includes/stmpfl_header_php.php
Normal file
6
fileTemplates/includes/stmpfl_header_php.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* ${NAME}
|
||||
*
|
||||
* @copyright Copyright © ${YEAR} ${company}. All rights reserved.
|
||||
* @author ${userEmail}
|
||||
*/
|
9
fileTemplates/includes/stmpfl_header_xml.xml
Normal file
9
fileTemplates/includes/stmpfl_header_xml.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* ${NAME}
|
||||
*
|
||||
* @copyright Copyright © ${YEAR} ${company}. All rights reserved.
|
||||
* @author ${userEmail}
|
||||
*/
|
||||
-->
|
2
fileTemplates/includes/stmpfl_variables.txt.dist
Normal file
2
fileTemplates/includes/stmpfl_variables.txt.dist
Normal file
|
@ -0,0 +1,2 @@
|
|||
#set($company = "<company_name>")
|
||||
#set($userEmail = "<user_email>")
|
13
fileTemplates/internal/PHP Class.php
Normal file
13
fileTemplates/internal/PHP Class.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
#parse("stmpfl_variables.txt")
|
||||
#parse("stmpfl_header_php.php")
|
||||
|
||||
#if (${NAMESPACE})
|
||||
|
||||
namespace ${NAMESPACE};
|
||||
|
||||
#end
|
||||
|
||||
class ${NAME} {
|
||||
|
||||
}
|
780
templates/StmpflMagento2.xml
Normal file
780
templates/StmpflMagento2.xml
Normal file
|
@ -0,0 +1,780 @@
|
|||
<templateSet group="StmpflMagento2">
|
||||
<template name="2magento sequence" value="<sequence> <module name="$VendorName_ModuleName$"/> </sequence>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="VendorName_ModuleName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento system section" value="<section id="$section$" translate="label" type="text" sortOrder="999" showInDefault="1" showInWebsite="0" showInStore="0"> <label>$capitalizedSection$</label> <tab>$tab$</tab> <resource>$resource$</resource> <group id="$group$" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0"> <label>$capitalizedGroup$</label> <field id="$field$" translate="label" type="$type$" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0"> <label>$capitalizedField$</label> <!-- <comment>Some comment here...</comment> --> <!-- <frontend_class>required-entry</frontend_class> --> </field> </group> </section>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="section" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedSection" expression="capitalize(section)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="tab" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="resource" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="group" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedGroup" expression="capitalize(group)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="field" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedField" expression="capitalize(field)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento admin menu active" value="$resultPage->setActiveMenu('$Menu$') ->addBreadcrumb(__('$breadcrum1$'), __('$breadcrum1$')) ->addBreadcrumb(__('$breadcrum2$'), __('$breadcrum2$')); $resultPage->getConfig()->getTitle()->prepend(__('$title$'));" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="Menu" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="breadcrum1" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="breadcrum2" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="title" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento grid text column" value="<column name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="filter" xsi:type="string">text</item> <item name="editor" xsi:type="array"> <item name="editorType" xsi:type="string">text</item> <!-- validators here... --> </item> <item name="label" xsi:type="string" translate="true">$capitalizedFieldName$</item> <item name="visible" xsi:type="boolean">true</item> </item> </argument> </column> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento grid select column" value="<column name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="options" xsi:type="object">$sourceModel$</item> <item name="config" xsi:type="array"> <item name="filter" xsi:type="string">select</item> <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item> <item name="editor" xsi:type="string">select</item> <item name="dataType" xsi:type="string">select</item> <item name="label" xsi:type="string" translate="true">$capitalizedFieldName$</item> <item name="visible" xsi:type="boolean">true</item> </item> </argument> </column> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="sourceModel" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento grid date column" value="<column name="$fieldName$" class="Magento\Ui\Component\Listing\Columns\Date"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="filter" xsi:type="string">dateRange</item> <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item> <item name="dataType" xsi:type="string">date</item> <item name="label" xsi:type="string" translate="true">$capitalizedFieldName$</item> <item name="visible" xsi:type="boolean">true</item> </item> </argument> </column> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento grid store column" value="<column name="store_id" class="Magento\Store\Ui\Component\Listing\Column\Store"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item> <item name="sortable" xsi:type="boolean">false</item> <item name="label" xsi:type="string" translate="true">Store View</item> </item> </argument> </column> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento fieldset" value="<fieldset name="$fieldsetId$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="label" xsi:type="string" translate="true">$capitalizedFieldsetName$</item> <item name="collapsible" xsi:type="boolean">true</item> <item name="opened" xsi:type="boolean">false</item> <item name="sortOrder" xsi:type="number">$order$</item> </item> </argument> <!-- Add your fields here --> $END$ </fieldset> " description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldsetId" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldsetName" expression="capitalize(fieldsetId)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field text" value="<field name="$fieldId$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">text</item> <item name="label" translate="true" xsi:type="string">$capitalizedFieldName$</item> <item name="formElement" xsi:type="string">input</item> <item name="sortOrder" xsi:type="string">$order$</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldId" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldId)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field select" value="<field name="$fieldId$"> <argument name="data" xsi:type="array"> <item name="options" xsi:type="object">$UiComponent$</item> <item name="config" xsi:type="array"> <item name="label" translate="true" xsi:type="string">$capitalizedFieldName$</item> <item name="dataType" xsi:type="string">text</item> <item name="formElement" xsi:type="string">select</item> <item name="sortOrder" xsi:type="string">$order$</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldId" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="UiComponent" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldId)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field date" value="<field name="$fieldId$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="label" translate="true" xsi:type="string">$capitalizedFieldName$</item> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">text</item> <item name="formElement" xsi:type="string">date</item> <item name="sortOrder" xsi:type="string">$order$</item> <item name="validation" xsi:type="array"> <item name="validate-date" xsi:type="boolean">true</item> </item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldId" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldId)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento widget param select" value="<parameter name="$name$" xsi:type="select" source_model="$source$" visible="true" sort_order="$sortOrder$" > <label translate="true">$label$</label> </parameter> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="source" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="sortOrder" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="label" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento widget param text" value="<parameter name="$name$" xsi:type="text" visible="true" sort_order="$sortOrder$" > <label translate="true">$label$</label> </parameter> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="sortOrder" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="label" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento javascript" value="<script type="text/x-magento-init"> { "*": { "$objectName$": { "$option1$": "$value1$", "$option2$": "$value2$" } } } </script>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="objectName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="option1" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="value1" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="option2" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="value2" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="HTML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento phpcs ignore block" value="//@codingStandardsIgnoreStart $SELECTION$ //@codingStandardsIgnoreEnd" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="HTML" value="true" />
|
||||
<option name="XML" value="true" />
|
||||
<option name="CSS" value="true" />
|
||||
<option name="JAVA_SCRIPT" value="true" />
|
||||
<option name="SQL" value="true" />
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento phpcs ignore line" value="//@codingStandardsIgnoreLine" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento config save" value="/** @var \Magento\Config\Model\ResourceModel\Config $this->config **/ $this->config->saveConfig('$path$', $value$, 'default', 0);" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="path" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="value" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento table new" value="/** * Create table '$table_name$' */ $table = $setup->getConnection()->newTable( $setup->getTable('$table_name$') )->addColumn( '$id$', Table::TYPE_SMALLINT, null, ['identity' => true, 'nullable' => false, 'primary' => true], '$id$' )->addIndex( $setup->getIdxName('$table_name$', ['$id$']), ['$id$'] )->setComment( '$description$' ); // More columns here $END$ $setup->getConnection()->createTable($table);" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="table_name" expression="" defaultValue="table_name" alwaysStopAt="true" />
|
||||
<variable name="id" expression="" defaultValue="id" alwaysStopAt="true" />
|
||||
<variable name="description" expression="" defaultValue="Some description" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento table column" value="$table->addColumn( '$fieldName$', Table::TYPE_$type$, null, ['nullable' => true, 'default' => '$defaultValue$'], '$fieldName$' ); $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="field_name" alwaysStopAt="true" />
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="defaultValue" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento table foreignKey" value=" $table->addColumn( '$currentId$', Table::TYPE_$type$, null, ['nullable' => false, 'primary' => true], 'Foreign Key $currentId$' )->addForeignKey( $setup->getFkName('$currentTable$', '$currentId$', '$foreignTable$', '$foreignId$'), '$currentId$', $setup->getTable('$foreignTable$'), '$foreignId$', Table::ACTION_$actionType$ ); $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="currentId" expression="" defaultValue="current_id" alwaysStopAt="true" />
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="currentTable" expression="" defaultValue="current_table" alwaysStopAt="true" />
|
||||
<variable name="foreignTable" expression="" defaultValue="foreign_table" alwaysStopAt="true" />
|
||||
<variable name="foreignId" expression="" defaultValue="foreign_id" alwaysStopAt="true" />
|
||||
<variable name="actionType" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field file" value="<field name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <!--<item name="label" translate="true" xsi:type="string">$capitalizedFieldName$</item>--> <item name="formElement" xsi:type="string">fileUploader</item> <item name="componentType" xsi:type="string">fileUploader</item> <item name="notice" xsi:type="string" translate="true">Allowed file types: jpeg, gif, png</item> <item name="maxFileSize" xsi:type="number">2097152</item> <item name="allowedExtensions" xsi:type="string">jpg jpeg gif png</item> <item name="uploaderConfig" xsi:type="array"> <item name="url" xsi:type="string">$routeId$/file/uploader</item> </item> <item name="sortOrder" xsi:type="string">$order$</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="routeId" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field hidden" value="<field name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">number</item> <item name="formElement" xsi:type="string">hidden</item> <item name="sortOrder" xsi:type="string">$order$</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field dynamic" value="<dynamicRows name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="componentType" xsi:type="string">dynamicRows</item> <item name="recordTemplate" xsi:type="string">record</item> <item name="sortOrder" xsi:type="string">$order$</item> <item name="addButton" xsi:type="boolean">true</item> <item name="label" xsi:type="string" translate="true">$capitalizedFieldName$</item> <item name="visible" xsi:type="boolean">true</item> <item name="dndConfig" xsi:type="array"> <item name="enabled" xsi:type="boolean">true</item> </item> </item> </argument> <container name="record"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="isTemplate" xsi:type="boolean">true</item> <item name="is_collection" xsi:type="boolean">true</item> <item name="component" xsi:type="string">Magento_Ui/js/dynamic-rows/record</item> <item name="componentType" xsi:type="string">container</item> <item name="showFallbackReset" xsi:type="boolean">false</item> </item> </argument> <field name="id"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="visible" xsi:type="boolean">false</item> <item name="dataType" xsi:type="string">number</item> <item name="formElement" xsi:type="string">hidden</item> <item name="source" xsi:type="string">images_fieldset</item> </item> </argument> </field> <field name="position"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">number</item> <item name="formElement" xsi:type="string">hidden</item> <item name="source" xsi:type="string">images_fieldset</item> </item> </argument> </field> <!-- Add your fields here --> $END$ <actionDelete> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="componentType" xsi:type="string">actionDelete</item> <item name="dataType" xsi:type="string">text</item> <item name="fit" xsi:type="boolean">false</item> <item name="sortOrder" xsi:type="string">50</item> </item> </argument> </actionDelete> </container> </dynamicRows>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field wysiwyg" value="<field name="$fieldName$"><!-- Do not use "-" on the field name. It breaks the WYSIWYG --> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="label" xsi:type="string">$capitalizedFieldName$</item> <item name="sortOrder" xsi:type="number">$order$</item> <item name="formElement" xsi:type="string">wysiwyg</item> <item name="wysiwyg" xsi:type="boolean">true</item> <item name="wysiwygConfigData" xsi:type="array"> <item name="hidden" xsi:type="boolean">false</item> <item name="settings" xsi:type="array"> <item name="theme_advanced_buttons1" xsi:type="string">bold,italic,|,justifyleft,justifycenter,justifyright,|,fontselect,fontsizeselect,|,forecolor,backcolor,|,link,unlink,|,bullist,numlist,|,code</item> <item name="theme_advanced_buttons2" xsi:type="boolean">false</item> <item name="theme_advanced_buttons3" xsi:type="boolean">false</item> <item name="theme_advanced_buttons4" xsi:type="boolean">false</item> <item name="theme_advanced_statusbar_location" xsi:type="boolean">false</item> </item> <item name="files_browser_window_url" xsi:type="boolean">false</item> <item name="height" xsi:type="string">100px</item> <item name="toggle_button" xsi:type="boolean">false</item> <item name="add_widgets" xsi:type="boolean">false</item> <item name="add_variables" xsi:type="boolean">false</item> <item name="add_images" xsi:type="boolean">false</item> </item> <item name="template" xsi:type="string">ui/form/field</item> <item name="additionalClasses" xsi:type="string">admin__field-wide</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento widget xml" value="<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="$widgetId$" class="$class$"> <label translate="true">$label$</label> <description>$description$</description> <parameters> $END$ </parameters> </widget> </widgets>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="widgetId" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="label" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="description" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento block widget" value="use Magento\Framework\View\Element\Template; use Magento\Widget\Block\BlockInterface; class $class$ extends Template implements BlockInterface { /** * @var string $_template */ protected $_template = "$template$.phtml"; // write your methods here... $END$ }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="template" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento source option" value="use Magento\Framework\Data\OptionSourceInterface; use Magento\Framework\Option\ArrayInterface; class $class$ implements OptionSourceInterface, ArrayInterface { /** * @var array $options */ protected $options = []; /** * Get Options * * @return array */ public function toOptionArray() { if (!$this->options) { $this->options[] = ['value' => '', 'label' => '']; } return $this->options; } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento layout" value="<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="$layout$" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> $END$ </body> </page>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="layout" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento requirejs-config" value="var config = { map: { '*': { ${objectName}: '$vendor$_$package$/js/$jsFileName$' } } }; " description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="vendor" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="package" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="jsFileName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="JAVA_SCRIPT" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento js class" value="/*jshint jquery:true*/ define([ "jquery", "jquery/ui" ], function($){ "use strict"; $.widget('$widgetName$', { options: { // optionName: value }, /** * Bind a click handler on the widget's element. * @private */ _create: function() { this.element.on('click', $.proxy(this._clickAction, this)); }, /** * Init object * @private */ _init: function () { // Do something if needed }, /** * Click action function * @private * @param event - {Object} - Click event. */ _clickAction: function(event) { // Do something with element clicked $(event.target) } }); return $.$widgetName$; });" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="widgetName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="JAVA_SCRIPT" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento acl xml" value="<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"> $END$ </resource> </resources> </acl> </config> " description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento config xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> $END$ </default> </config>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento Controller Admin" value="use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; use Magento\Framework\View\Result\PageFactory; class $className$ extends Action { /** * @var PageFactory */ protected $resultPageFactory; /** * @param Context $context * @param PageFactory $resultPageFactory */ public function __construct( Context $context, PageFactory $resultPageFactory ) { parent::__construct($context); $this->resultPageFactory = $resultPageFactory; } /** * Check the permission to run it * * @return boolean */ protected function _isAllowed() { return $this->_authorization->isAllowed('$acl$'); } /** * Index action * * @return \Magento\Backend\Model\View\Result\Page */ public function execute() { /** @var \Magento\Backend\Model\View\Result\Page $resultPage */ $resultPage = $this->resultPageFactory->create(); return $resultPage; } } " description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="className" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="acl" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento Controller Front" value="use Magento\Framework\App\Action\Action; use Magento\Framework\View\Result\PageFactory; use Magento\Framework\App\Action\Context; class $className$ extends Action { /** * @var PageFactory */ protected $pageFactory; /** * @param Context $context * @param PageFactory $pageFactory */ public function __construct(Context $context, PageFactory $pageFactory) { parent::__construct($context); $this->pageFactory = $pageFactory; } /** * Index Action * * @return \Magento\Framework\View\Result\Page */ public function execute() { /** @var \Magento\Framework\View\Result\Page $resultPage */ $resultPage = $this->pageFactory->create(); return $resultPage; } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="className" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento di xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> $END$ </config>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento helper" value="use Magento\Framework\App\Helper\AbstractHelper; class $className$ extends AbstractHelper { $END$ }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="className" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento InstallSchema" value="use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Framework\Setup\ModuleContextInterface; /** * @codeCoverageIgnore */ class InstallSchema implements InstallSchemaInterface { /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); // Install actions here... $END$ $setup->endSetup(); } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento menu xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> $END$ </menu> </config>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento module xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="$VendorName$_$ModuleName$" setup_version="0.0.1" > $END$ </module> </config>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="VendorName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="ModuleName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento routes xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="$type$"> <!-- standard or admin --> <route id="$name$" frontName="$name$"> <module name="$VendorName$_$ModuleName$" /> </route> </router> </config>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="VendorName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="ModuleName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento system xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> $END$ </system> </config>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento InstallData" value="use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; /** * @codeCoverageIgnore */ class InstallData implements InstallDataInterface { /** * {@inheritdoc} * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); // Install here your data... $END$ $setup->endSetup(); } } " description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav text attribute" value="$attributes['$fieldName$'] = [ 'type' => 'varchar', 'label' => '$capitalizedFieldName$', 'input' => 'text', 'required' => $required$, //true/false 'sort_order' => $position$, 'global' => ScopedAttributeInterface::$scope$, 'group' => 'General', //'validate_rules' => 'a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}', ];" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="required" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="position" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="scope" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav textarea attribute" value="$attributes['$fieldName$'] = [ 'type' => 'text', 'label' => '$capitalizedFieldName$', 'input' => 'textarea', 'required' => $required$, //true/false 'sort_order' => $position$, 'global' => ScopedAttributeInterface::$scope$, 'group' => 'General', 'wysiwyg_enabled' => true, ];" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="required" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="position" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="scope" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav boolean attribute" value="$attributes['$fieldName$'] = [ 'type' => 'int', 'label' => '$capitalizedFieldName$', 'input' => 'select', 'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean', 'required' => $required$, //true/false 'sort_order' => $position$, 'global' => ScopedAttributeInterface::$scope$, 'group' => 'General', ];" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="required" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="position" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="scope" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav date attribute" value="$attributes['$fieldName$'] = [ 'type' => 'datetime', 'label' => '$capitalizedFieldName$', 'input' => 'date', 'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\Datetime', 'required' => $required$, //true/false 'sort_order' => $position$, 'global' => ScopedAttributeInterface::$scope$, 'group' => 'General', 'validate_rules' => 'a:1:{s:16:"input_validation";s:4:"date";}', ];" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="required" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="position" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="scope" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field validation" value="<item name="validation" xsi:type="array"> <item name="required-entry" xsi:type="boolean">true</item> <!--<item name="validate-email" xsi:type="boolean">true</item>--> <!--<item name="integer" xsi:type="boolean">true</item>--> </item>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field boolean" value="<field name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="sortOrder" xsi:type="number">$order$</item> <item name="dataType" xsi:type="string">boolean</item> <item name="formElement" xsi:type="string">checkbox</item> <item name="prefer" xsi:type="string">toggle</item> <item name="label" xsi:type="string" translate="true">$capitalizedFieldName$</item> <item name="valueMap" xsi:type="array"> <item name="true" xsi:type="string">1</item> <item name="false" xsi:type="string">0</item> </item> <item name="validation" xsi:type="array"> <item name="required-entry" xsi:type="boolean">false</item> </item> <item name="default" xsi:type="string">1</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento getFirstElement" value="// get first item found $this->collection->getSelect()->limit(1); foreach ($this->collection as $item) { return $item; }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav static attribute" value="$attributes['$fieldName$'] = [ 'type' => 'static', 'label' => '$capitalizedFieldName$', 'input' => 'text', 'required' => $required$, //true/false 'sort_order' => $position$, 'global' => ScopedAttributeInterface::SCOPE_GLOBAL, 'group' => 'General', //'validate_rules' => 'a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}', ];" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="required" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="position" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento grid boolean column" value="<column name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="options" xsi:type="object">Magento\Eav\Model\Entity\Attribute\Source\Boolean</item> <item name="config" xsi:type="array"> <item name="filter" xsi:type="string">select</item> <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item> <item name="editor" xsi:type="string">select</item> <item name="dataType" xsi:type="string">select</item> <item name="label" xsi:type="string" translate="true">$capitalizedFieldName$</item> <item name="visible" xsi:type="boolean">true</item> </item> </argument> </column> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento grid integer column" value="<column name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="filter" xsi:type="string">textRange</item> <item name="editor" xsi:type="array"> <item name="editorType" xsi:type="string">text</item> <item name="validation" xsi:type="array"> <item name="integer" xsi:type="boolean">true</item> </item> </item> <item name="label" xsi:type="string" translate="true">$capitalizedFieldName$</item> <item name="visible" xsi:type="boolean">true</item> </item> </argument> </column> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field integer" value="<field name="$fieldName$"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">number</item> <item name="label" xsi:type="string">$capitalizedFieldName$</item> <item name="formElement" xsi:type="string">input</item> <item name="sortOrder" xsi:type="string">$order$</item> <item name="default" xsi:type="number">0</item> <item name="validation" xsi:type="array"> <item name="integer" xsi:type="boolean">true</item> </item> </item> </argument> </field>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento current dates collection function" value="/** * Set Filters to get current entries from collection */ protected function setCurrentDatesFilterCollection() { $currentDate = $this->dateTime->formatDate(true); $this->$collection$->addFieldToFilter('is_active', 1) ->addAttributeToSelect(['date_from', 'date_to'], 'left') // VERY IMPORTANT: this is needed if we want the filter to properly work for those new where dates are not specify ->addFieldToFilter('date_from', [['lteq' => $currentDate], ['null' => 'this_value_doesnt_matter']], 'left') ->addFieldToFilter('date_to', [['gteq' => $currentDate], ['null' => 'this_value_doesnt_matter']], 'left'); } $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="collection" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento config get" value="/** @var \Magento\Framework\App\Config\ScopeConfigInterface $this->scopeConfig **/ $this->scopeConfig->getValue($path$, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="path" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento block template" value="use Magento\Framework\View\Element\Template; class $class$ extends Template { /** * @var string $_template */ protected $_template = "$template$.phtml"; // write your methods here... $END$ }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="class" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="template" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento show time date item" value="<item name="options" xsi:type="array"> <item name="timeFormat" xsi:type="string">H:mm</item> <item name="showsTime" xsi:type="boolean">true</item> </item> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento phpmd suppress warnings" value="@SuppressWarnings(PHPMD.$warning$) // https://phpmd.org/rules/index.html" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="warning" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav image attribute" value="$attributes['$fieldName$'] = [ 'type' => 'varchar', 'label' => '$capitalizedFieldName$', 'input' => 'image', 'backend' => '$vendor$\$package$\Model\Attribute\Backend\Image', 'required' => $required$, //true/false 'sort_order' => $position$, 'global' => ScopedAttributeInterface::$scope$, 'group' => 'General', ]; $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="vendor" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="package" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="required" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="position" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="scope" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento upgradeSchema" value="use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Setup\UpgradeSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; /** * @codeCoverageIgnore */ class UpgradeSchema implements UpgradeSchemaInterface { /** * {@inheritdoc} */ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); if (version_compare($context->getVersion(), '$version$', '<')) { $this->upgradeVersion$versionMethod$(); } $setup->endSetup(); } /** * Upgrade script for version $version$ * * @return void */ protected function upgradeVersion$versionMethod$() { // Add here your data upgrade $END$ } } " description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="version" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="versionMethod" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento upgradeData" value="use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; /** * @codeCoverageIgnore */ class UpgradeData implements UpgradeDataInterface { /** * {@inheritdoc} * @SuppressWarnings(PHPMD.NPathComplexity) */ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); if (version_compare($context->getVersion(), '$version$', '<')) { $this->upgradeVersion$versionMethod$(); } $setup->endSetup(); } /** * Upgrade script for version $version$ * * @return void */ protected function upgradeVersion$versionMethod$() { // Add here your data upgrade $END$ } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="version" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="versionMethod" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav source option" value="use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; class $class$ extends AbstractSource { /** * @var array $options */ protected $options; /** * Get Options * * @return array */ public function getAllOptions() { if ($this->options == null) { $this->options = ['value' => '', 'label' => '']; } return $this->options; } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento events observer xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="$event$"> <observer name="$prefix$_$event$" instance="$vendor$\$module$\Observer\$class$" /> </event> </config>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="event" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="prefix" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="vendor" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="module" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento eav attribute product" value="/** * Add attributes to the eav/attribute */ $eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, '$attribute$', [ 'type' => '$type$', 'backend' => '', 'frontend' => '', 'label' => '$label$', 'input' => '', 'class' => '', 'source' => '', 'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL, 'visible' => true, 'required' => false, 'user_defined' => false, 'default' => 0, 'searchable' => false, 'filterable' => false, 'comparable' => false, 'visible_on_front' => false, 'used_in_product_listing' => true, 'unique' => false, 'apply_to' => '', 'is_used_in_grid' => true, 'is_visible_in_grid' => false, 'is_filterable_in_grid' => true, ] ); " description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="attribute" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="label" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento validate-digits js xml" value="validate-digits validate-digits-range digits-range-$min$-$max$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="min" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="max" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento add column" value="$setup->getConnection()->addColumn( $setup->getTable('$tableName$'), '$columnName$', [ 'type' => Table::TYPE_$type$, 'length' => null, 'nullable' => true, 'default' => '$default$', 'comment' => '$columnName$', ] );" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="tableName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="columnName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="default" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento observer" value="use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Event\Observer; class $class$ implements ObserverInterface { /** * Execute Observer * * @param Observer $observer * @return void */ public function execute(Observer $observer) { $END$ } } " description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento view xml" value="<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> $END$ </view>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento disable component layout xml" value="<referenceBlock name="$blockName$"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="$componentName$" xsi:type="array"> <item name="config" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> </item> </item> </argument> </arguments> </referenceBlock>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="blockName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="componentName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento factory simple" value="use Magento\Framework\ObjectManagerInterface; class $className$ { /** * Object Manager instance * * @var ObjectManagerInterface */ protected $_objectManager = null; /** * Instance name to create * * @var string */ protected $_instanceName = null; /** * Factory constructor * * @param ObjectManagerInterface $objectManager * @param string $instanceName */ public function __construct(ObjectManagerInterface $objectManager, $instanceName = '\\$vendor$\\$module$\\$restNamespace$') { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; } /** * Create class instance with specified parameters * * @param array $data * @return \$vendor$\$module$\$restNamespace$ */ public function create(array $data = array()) { return $this->_objectManager->create($this->_instanceName, $data); } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="className" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="vendor" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="module" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="restNamespace" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento factory type option" value="use InvalidArgumentException; use Magento\Framework\ObjectManagerInterface; use $vendor$\$module$\$restClassType$; class $className$ { /** * Object Manager instance * * @var ObjectManagerInterface */ protected $objectManager = null; /** * Instance name to create * * @var string */ protected $instanceTypeNames = [ '$type1$' => \$vendor$\$module$\$restClass$\$className1$::class, '$type2$' => \$vendor$\$module$\$restClass$\$className2$::class, ]; /** * Factory constructor * * @param ObjectManagerInterface $objectManager */ public function __construct(ObjectManagerInterface $objectManager) { $this->objectManager = $objectManager; } /** * Create corresponding class instance * * @param $type * @param array $data * @return ObjectType */ public function create($type, array $data = array()) { if (empty($this->instanceTypeNames[$type])) { throw new InvalidArgumentException(sprintf('"%s": isn\'t allowed', $type)); } $resultInstance = $this->objectManager->create($this->instanceTypeNames[$type], $data); if (!$resultInstance instanceof $restClassType$) { throw new InvalidArgumentException(sprintf('%s isn\'t instance of %s', get_class($resultInstance), $restClassType$::class )); } return $resultInstance; } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="vendor" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="module" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="restClassType" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="className" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="type1" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="restClass" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="className1" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="type2" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="className2" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento email_templates xml" value="<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="$lowerVendorname$_$lowerModulename$_email_$copyEmailname$_template" label="$module" file="$emailname$.html" type="text" module="$Vendorname$_$Modulename$" area="adminhtml"/> </config> " description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="Vendorname" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="Modulename" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="emailname" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="lowerVendorname" expression="decapitalize(Vendorname)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="lowerModulename" expression="decapitalize(Modulename)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="copyEmailname" expression="decapitalize(emailname)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento plugin before" value="public function before$method$($subjectClass$ $subject, $param1, $param2) { // return array of modified arguments return [$param1, $param2]; }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="method" expression="capitalize(String)" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="subjectClass" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento plugin after" value="public function after$method$($subjectClass$ $subject, $result) { // Do something and return the customised result return $result; }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="method" expression="capitalize(String)" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="subjectClass" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento plugin around" value="public function around$method$($subjectClass$ $subject, callable $proceed) { $this->doSmthBefore(); $result = $proceed(); $this->doSmthAfter(); return $result; }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="method" expression="capitalize(String)" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="subjectClass" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test objectManager" value="$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test integration" value="class $className$ extends \PHPUnit\Framework\TestCase { protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); //@TODO: create your object instances here... //$this->someObject = $objectManager->create(\Some\Class::class); } public function testNothing() { $this->fail('Test is properly setup'); } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="className" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test annotation fixture" value="/** * @magentoAppIsolation enabled * @magentoDbIsolation enabled * @magentoDataFixture /../../../../../../dev/tests/integration/testsuite/Magento/$fixtureFile$.php */ public function test$name$() { // $this->assert... }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fixtureFile" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test dataProvider function" value="/** * @dataProvider $providerName$DataProvider */ public function test$name$(array $data) { // $this->assert... } public function $providerName$DataProvider() { return [ [ 'key1' => 'value1', ], ]; }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="providerName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento customer add attribute" value="/** @var CustomerSetup $customerSetup */ $this->customerSetup = $this->customerSetupFactory->create(['setup' => $setup]); $this->customerSetup->addAttribute( \Magento\Customer\Model\Customer::ENTITY, $attributeCode, [ 'type' => $type$, //varchar, int, text, datetime, decimal, static 'label' => $label$, 'input' => $input$, //text, select, textarea, date, hidden 'required' => $required$, //true, false 'sort_order' => $sortOrder$, 'visible' => true, 'user_defined' => 0, 'system' => false, 'is_used_in_grid' => false, //'source' => Vendor\Package\..., ] ); $attribute = $this->customerSetup->getEavConfig()->getAttribute(\Magento\Customer\Model\Customer::ENTITY, $attributeCode); $forms = ['adminhtml_customer']; if ($showOnFrontend) { $forms = [ 'adminhtml_customer', 'customer_account_create', 'customer_account_edit', 'checkout_register', 'adminhtml_checkout', ]; } $attribute->setData('used_in_forms', $forms); $attribute->save(); //@codingStandardsIgnoreLine" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="label" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="input" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="required" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="sortOrder" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field wysiwyg simple" value="<field name="$fieldName$"><!-- Do not use "-" on the field name. It breaks the WYSIWYG --> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="label" xsi:type="string">$capitalizedFieldName$</item> <item name="sortOrder" xsi:type="number">$order$</item> <item name="formElement" xsi:type="string">wysiwyg</item> <item name="wysiwyg" xsi:type="boolean">true</item> <item name="wysiwygConfigData" xsi:type="array"> <item name="hidden" xsi:type="boolean">false</item> <item name="settings" xsi:type="array"> <item name="theme_advanced_buttons1" xsi:type="string">bold,italic,|,formatselect,|,link,unlink,|,bullist</item> <item name="theme_advanced_buttons2" xsi:type="boolean">false</item> <item name="theme_advanced_buttons3" xsi:type="boolean">false</item> <item name="theme_advanced_buttons4" xsi:type="boolean">false</item> <item name="theme_advanced_statusbar_location" xsi:type="boolean">false</item> </item> <item name="files_browser_window_url" xsi:type="boolean">false</item> <item name="height" xsi:type="string">100px</item> <item name="toggle_button" xsi:type="boolean">false</item> <item name="add_widgets" xsi:type="boolean">false</item> <item name="add_variables" xsi:type="boolean">false</item> <item name="add_images" xsi:type="boolean">false</item> </item> <item name="template" xsi:type="string">ui/form/field</item> <item name="additionalClasses" xsi:type="string">admin__field-wide</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento field wysiwyg simple + widgets" value="<field name="$fieldName$"><!-- Do not use "-" on the field name. It breaks the WYSIWYG --> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="label" xsi:type="string">$capitalizedFieldName$</item> <item name="sortOrder" xsi:type="number">$order$</item> <item name="formElement" xsi:type="string">wysiwyg</item> <item name="wysiwyg" xsi:type="boolean">true</item> <item name="wysiwygConfigData" xsi:type="array"> <item name="hidden" xsi:type="boolean">false</item> <item name="settings" xsi:type="array"> <item name="theme_advanced_buttons1" xsi:type="string">magentowidget,|,bold,italic,|,formatselect,|,link,unlink,|,bullist</item> <item name="theme_advanced_buttons2" xsi:type="boolean">false</item> <item name="theme_advanced_buttons3" xsi:type="boolean">false</item> <item name="theme_advanced_buttons4" xsi:type="boolean">false</item> <item name="theme_advanced_statusbar_location" xsi:type="boolean">false</item> </item> <item name="files_browser_window_url" xsi:type="boolean">false</item> <item name="height" xsi:type="string">100px</item> <item name="toggle_button" xsi:type="boolean">false</item> <item name="add_widgets" xsi:type="boolean">true</item> <item name="add_variables" xsi:type="boolean">false</item> <item name="add_images" xsi:type="boolean">false</item> </item> <item name="template" xsi:type="string">ui/form/field</item> <item name="additionalClasses" xsi:type="string">admin__field-wide</item> </item> </argument> </field> $END$" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fieldName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="capitalizedFieldName" expression="capitalize(fieldName)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="order" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento setup order quote field" value="// @todo: move on top of your installData/upgradeData class. // /** // * @var \Magento\Sales\Setup\SalesSetupFactory // */ // private $salesSetupFactory; // /** // * @var \Magento\Quote\Setup\QuoteSetupFactory // */ // private $quoteSetupFactory; // // public function __construct( // \Magento\Sales\Setup\SalesSetupFactory $salesSetupFactory, // \Magento\Quote\Setup\QuoteSetupFactory $quoteSetupFactory // ) { // $this->salesSetupFactory = $salesSetupFactory; // $this->quoteSetupFactory = $quoteSetupFactory; // } /** @var \Magento\Framework\Setup\ModuleDataSetupInterface $setup */ /** @var \Magento\Quote\Setup\QuoteSetup $quoteSetup */ $quoteSetup = $this->quoteSetupFactory->create(['setup' => $setup]); $quoteSetup->addAttribute( '$quoteEntityType$', '$fieldname$', ['type' => \Magento\Framework\DB\Ddl\Table::$type$, 'length' => $length$, 'nullable' => true, 'comment' => 'Quote $fieldname$'] ); /** @var \Magento\Sales\Setup\SalesSetup $salesSetup */ $salesSetup = $this->salesSetupFactory->create(['setup' => $setup]); $salesSetup->addAttribute( '$orderEntityType$', '$fieldname$', ['type' => \Magento\Framework\DB\Ddl\Table::$type$, 'length' => $length$, 'nullable' => true, 'grid' => false, 'comment' => 'Order $fieldname$'] ); // @todo: Add into module.xml // <sequence> // <module name="Magento_Quote"/> // <module name="Magento_Sales"/> // </sequence>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="quoteEntityType" expression="" defaultValue=""quote"" alwaysStopAt="true" />
|
||||
<variable name="fieldname" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="length" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="orderEntityType" expression="" defaultValue=""order"" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento setup uninstall" value="use Magento\Framework\Setup\UninstallInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Framework\Setup\ModuleContextInterface; class Uninstall implements UninstallInterface { /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @param SchemaSetupInterface $setup * @param ModuleContextInterface $context */ public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); // $setup->getConnection()->dropTable( // $setup->getTable('table_name') // ); // // $setup->getConnection()->dropColumn( // $setup->getTable('table_name'), // 'column_name' // ); $setup->endSetup(); } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento webapi xml" value="<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/$subpath$/$methodUrl$" method="PUT"> <service class="$vendor$\$module$\Api\$api$Interface" method="$method$"/> <resources> <resource ref="anonymous"/> </resources> </route> </routes>" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="subpath" expression="" defaultValue=""subpath"" alwaysStopAt="true" />
|
||||
<variable name="methodUrl" expression="" defaultValue=""method"" alwaysStopAt="true" />
|
||||
<variable name="method" expression="camelCase(methodUrl)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="vendor" expression="" defaultValue=""Vendor"" alwaysStopAt="true" />
|
||||
<variable name="module" expression="" defaultValue=""Module"" alwaysStopAt="true" />
|
||||
<variable name="api" expression="" defaultValue=""ApiClass"" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento quote to order observer" value="/** * @param Observer $observer * @return void * @event sales_model_service_quote_submit_before */ public function execute(Observer $observer) { $this->addQuoteAttributeToOrder($observer); } private function addQuoteAttributeToOrder(Observer $observer) { /* @var $order \Magento\Sales\Model\Order */ $order = $observer->getEvent()->getOrder(); /** @var $quote \Magento\Quote\Model\Quote $quote */ $quote = $observer->getEvent()->getQuote(); $order->setData( '$attribute$', $quote->getData('$attribute$')); }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="attribute" expression="" defaultValue=""custom_attribute"" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento item quote to item order plugin" value="use Magento\Quote\Model\Quote\Item\ToOrderItem; class ToOrderItemPlugin { /** * @param ToOrderItem $subject * @param callable $proceed * @param Item|AddressItem $item * @param array $data * @return \Magento\Sales\Api\Data\OrderItemInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundConvert( ToOrderItem $subject, callable $proceed, $item, $data = [] ) { /** @var \Magento\Sales\Api\Data\OrderItemInterface $orderItem */ $orderItem = $proceed($item, $data); $orderItem->setData( '$attribute$', $item->getData('$attribute$') ); return $orderItem; } //@todo: add plugin in di.xml //<type name="Magento\Quote\Model\Quote\Item\ToOrderItem"> // <plugin name="$vendor$_$module$_add_to_order_item" type="$Vendor$\$Module$\Plugin\ToOrderItemPlugin"/> //</type> }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="attribute" expression="" defaultValue=""custom_attribute"" alwaysStopAt="true" />
|
||||
<variable name="vendor" expression="" defaultValue=""vendor"" alwaysStopAt="true" />
|
||||
<variable name="module" expression="" defaultValue=""module"" alwaysStopAt="true" />
|
||||
<variable name="Vendor" expression="capitalize(vendor)" defaultValue="" alwaysStopAt="false" />
|
||||
<variable name="Module" expression="capitalize(module)" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test annotation frontend store" value="/** * @magentoAppIsolation enabled * @magentoAppArea frontend * @magentoConfigFixture current_store general/locale/code de_CH */" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test change preference" value="\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure( ['preferences' => [$for$::class => $type$::class]] ); " toReformat="false" toShortenFQNames="true">
|
||||
<variable name="for" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi array" value="xsi:type="array"" description="xsi:type="array"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi string" value="xsi:type="string"" description="xsi:type="string"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi object" value="xsi:type="object"" description="xsi:type="object"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi" value="xsi:type="$SELECTION$"" description="xsi:type=""" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi number" value="xsi:type="number"" description="xsi:type="number"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi boolean" value="xsi:type="boolean"" description="xsi:type="boolean"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi const" value="xsi:type="const"" description="xsi:type="const"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi configurableObject" value="xsi:type="configurableObject"" description="xsi:type="configurableObject"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi null" value="xsi:type="null"" description="xsi:type="null"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi init_parameter" value="xsi:type="init_parameter"" description="xsi:type="init_parameter"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi options" value="xsi:type="options"" description="xsi:type="options"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi url" value="xsi:type="url"" description="xsi:type="url"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi helper" value="xsi:type="helper"" description="xsi:type="helper"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="xsi constant" value="xsi:type="constant"" description="xsi:type="constant"" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="XML" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test integration controller" value="class $className$ extends \Magento\TestFramework\TestCase\AbstractController { protected function setUp() { parent::setUp(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); //@TODO: create your object instances here... //$this->someObject = $objectManager->create(\Some\Class::class); } public function testNothing() { $this->fail('Test is properly setup'); } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="className" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test unit" value="class $className$ extends \PHPUnit\Framework\TestCase { public function testNothing() { $this->fail('Test is properly setup'); } }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="className" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="false" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test command execute method" value="private function executeCommand(string $commandIdentifier, array $arrayInput = []): string { // Workaround issue https://github.com/magento/magento2/issues/12844 \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure( [ 'preferences' => [ ltrim( \Magento\Framework\Interception\ObjectManager\ConfigInterface::class, '\\' ) => ltrim( \Magento\TestFramework\ObjectManager\Config::class, '\\' ), ], ] ); $commands = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create(\Magento\Framework\Console\CommandListInterface::class) ->getCommands(); $output = new BufferedOutput(); $commands[$commandIdentifier]->run( new ArrayInput($arrayInput), $output ); return $output->fetch(); } " description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test email" value="$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $mailTransportMock = $objectManager->get(\Magento\TestFramework\Mail\Template\TransportBuilderMock::class); $objectManager->addSharedInstance( $mailTransportMock, \Magento\Framework\Mail\Template\TransportBuilder::class ); // @TODO: your code that sends an email $sentEmail = $mailTransportMock->getSentMessage(); $this->assertInstanceOf(\Magento\Framework\Mail\Message::class, $sentEmail, 'Email should have been sent'); " description="" toReformat="false" toShortenFQNames="true">
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test loadFixture methods" value="public static function loadFixture() { include __DIR__ . '/../../../../../../dev/tests/integration/testsuite/Magento/$fileSubPath$.php'; } public static function loadFixtureRollback() { include __DIR__ . '/../../../../../../dev/tests/integration/testsuite/Magento/$fileSubPath$_rollback.php'; } /** * @magentoAppIsolation enabled * @magentoDbIsolation enabled * @magentoDataFixture loadFixture */ public function test$name$() { // $this->assert... }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="fileSubPath" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="2magento test layout frontend" value="/** * @magentoAppArea frontend */ public function test$testName$() { $layout = $this->getLayout('$handle$'); // Your test here... } /** * @param string|string[] $handles * @return \Magento\Framework\View\LayoutInterface */ protected function getLayout($handles) { /** @var \Magento\Framework\View\Result\Page $resultPage */ $resultPage = $this->_objectManager->get(\Magento\Framework\View\Result\Page::class); $resultPage->addHandle('default'); $resultPage->addHandle($handles); return $resultPage->getLayout(); }" description="" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="testName" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="handle" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="PHP" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
</templateSet>
|
Loading…
Reference in New Issue
Block a user