PHPStorm Magento 2 File Templates

Overview

phpstorm-m2-filetemplates

PHPStorm Magento 2 File Templates

Useful file templates for working with Magento 2.

To install, place the files directly in the appropriate folder. Note that [Version] corresponds to the version of PhpStorm you have installed.

Mac OS

PhpStorm 2020 or newer: ~/Library/Application Support/JetBrains/PhpStorm[VERSION]/fileTemplates/

PhpStorm 2019 and below: ~/Library/Preferences/PhpStorm[VERSION]/fileTemplates/

Windows

PhpStorm 2020 or newer: %USERPROFILE%\AppData\Roaming\JetBrains\PhpStorm[VERSION]/fileTemplates/

PhpStorm 2019 and below: %USERPROFILE%.PhpStorm[VERSION]\config\fileTemplates/

Linux

PhpStorm 2020 or newer: ~/.config/JetBrains/PhpStorm[VERSION]/fileTemplates/

PhpStorm 2019 and below: ~/.PhpStorm[VERSION]/config/fileTemplates/

Create the directories if they are not present.

Note that you must put the templates directly in the above folders, do not put them in a subfolder.

How to Use

Once the templates are installed, you can access them by right-clicking on a folder and selecting New, then From File Template. If you do not see this option, you may have to change your project schema for file templates.

Navigation to Preferences, Editor, File Templates. In that dialog, select Default under Schema. You should see the templates listed in the panel.

You might also like...
A simple plugin to override all woocommerce templates

A simple plugin to override all woocommerce templates

Rah memcached - Store parts of Textpattern CMS templates in Memcached

rah_memcached Packagist | Issues | Donate A plugin for Textpattern CMS that stores parts of your templates in Memcached, a distributed in-memory key-v

A PHP port of Ruby's Liquid Templates

Liquid template engine for PHP Liquid is a PHP port of the Liquid template engine for Ruby, which was written by Tobias Lutke. Although there are many

Benchmark of Elefant's template engine against Twig templates

Template Benchmark This is a simple benchmark to test the memory usage and speed of rendering templates using Elefant's Template engine, Twig, and Sma

TYPO3 CMS extension which extends TYPO3 page cache, by tags based on entities used in fluid templates.

Fluid Page Cache for TYPO3 CMS This TYPO3 CMS extension allows you to clear frontend page caches, automatically when a displayed record has been updat

A great Start for your next Magento Theme's local.xml file

Magento-local.xml-Template A Great Start for your next Magento Theme's local.xml file - ?xml version="1.0"? layout !-- Add/Remove Items From H

A faster drop in replacement for bin/magento cache:clean with file watcher

"You know, hope is a mistake. If you can't fix what's broken, you'll, uh... you'll go insane." - Max Rockatansky Magento 2 Cache Clean A faster drop i

Mage2click toolset to create and manage the Magento Docker development environment with mutagen.io file-sync for macOS and native filesystem mounts on Linux.
Mage2click toolset to create and manage the Magento Docker development environment with mutagen.io file-sync for macOS and native filesystem mounts on Linux.

Mage2click - Magento Docker Toolset Mage2click toolset is a system-wide command-line tool for creating and managing simultaneously running Magento Doc

Comments
  • Add template for ViewModel PHP Classes

    Add template for ViewModel PHP Classes

    ViewModels are the new best practice since 2.2 to extend block functionality using composition over inheritance. The basic idea is that you create a ViewModel class which implements Magento\Framework\View\Element\Block\ArgumentInterface and add it as an argument to a core template block using layout updates. This allows the developer to decouple dependencies and functionality from the block being extended.

    See https://medium.com/technogeeks/viewmodels-in-magento-2-7c141acda3c1 for more info.

    I have created a live template to add to this repository seen below. If you'd like to add me as a contributor I have many more I can offer as well. Cheers!

    M2 viewmodel.php.php

    <?php
    
    namespace ${VendorName}\${ModuleName}\ViewModel;
    
    use Magento\Framework\View\Element\Block\ArgumentInterface;
    
    /**
     * Class ${ClassName}
     * ViewModel to inject in template blocks
     */
    class ${ClassName} implements ArgumentInterface
    {
    
    }
    
    
    opened by pocketprogrammer 1
Owner
Laura Folco
Laura Folco
PHPStorm Live template preferences for Magento 2 Projects

Magento 2 PHPStorm Preferences This project is intended to setup useful PHPStorm Templates for Magento 2 Projects. Disclaimer This project overrides t

Stämpfli AG 229 Jul 18, 2022
PHPStorm Plugin for Magento 2

PhpStorm Magento 2 Plugin Installation Go to Settings > Preferences in the PhpStorm IDE Navigate to Plugins Click the Browse repositories... button an

Magento 395 Dec 21, 2022
🧩 Laravel Query Builder integration for PhpStorm

Laravel Query Laravel + DataGrip = ♥️ This plugin provides database integration for Laravel query builder. Features Schemas, tables, views and columns

Ernestas Kvedaras 41 Dec 14, 2022
Minimalistic Light colour scheme for PhpStorm

A minimalistic light colour scheme for PhpStorm If you need convincing of a light colour scheme, I'd like to direct you to a post on the topic. Colour

Brent Roose 269 Dec 24, 2022
Magento 2 Module to add simple image resizing capabilities in all blocks and .phtml templates

Magento 2 Image Resizer Magento 2 Module to add simple image resizing capabilities in all blocks and .phtml templates Installation $ composer require

Stämpfli AG 88 Apr 18, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery

File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.

Sebastian Tschan 31.1k Dec 30, 2022
Redaxo 5-Addon zum gruppieren beliebiger Inhaltsmodule (Blöcke) innerhalb eines Spaltenrasters mit selbst definierten Templates.

Gridblock Redaxo 5-Addon zum gruppieren beliebiger Inhaltsmodule (Blöcke) innerhalb eines Spaltenrasters. Die Inhaltsmodule entsprechen dabei den übli

Falko Müller 13 Jun 27, 2022