PhpStorm Live Templates for XenForo 2

PhpStorm Live Templates for XenForo 2 20210519

No permission to download

Kier

XenForo developer
Staff member
Kier submitted a new resource:

PhpStorm Live Templates for XenForo 2 - Shortcuts and macros for various commonly-used development text snippets

This is an export of the Live templates I use for XenForo development in PhpStorm. You can see them in use in the Building with XenForo 2 video series.

The list of templates is far from complete, and will be updated periodically as I get around to it but in the interest in sharing useful work, here they are.

View attachment 251620


To install them into PhpStorm, go to...

Read more about this resource...
 
For anyone who interested view imported templates after import.

Open Preferences, then Editor -> Live Templates. Then you can see groups named as "XenForo HTML", "XenForo LESS" and "XenForo PHP".
1620649294440.png

Good collection. Thanks Kier!
 
Doesn't work on macOS / phpStorm 2021.1.2 - have imported and restarted three times yet the templates do not appear:

1620651050042.png

The files exist in the directory structure, though:
1620651140950.png


EDIT: This is because of the "IDE Settings Sync" plugin. The files need to manually be added to ~/Library/Application Support/JetBrains/PhpStorm2021.1/jba_config/templates then restart phpStorm.

Source: https://www.jetbrains.com/help/phpstorm/sharing-live-templates.html
 
I found this nice tool to convert it into VS Code Snippets, but its not really working for me.

Does someone make this work?
 
Kier updated PhpStorm Live Templates for XenForo 2 with a new update entry:

More features, improved usability

In this update I have fairly dramatically changed the way you have to call the code snippets.

The previous releases suffered from a problem whereby the xf component of the shortcut trigger was treated as a separate word, so xf-entity would not search automatically for xf-entity but rather would search for shortcuts beginning with entity as soon as the cursor passed the dash character.

Having understood that now, the shortcuts are...

Read the rest of this update entry...
 
@Kier, first of all, thank you for this wonderful share. Do you use PhpStorm live templates for XenForo js codes? If you do and it's not personal, could you share it with us?


Edit: I saw it in the Update field. It turns out there's already a shortcut definition for Javascript in the PhpStorm templates you shared. It's called xfEventHandler. Thanks again Kier, my question was answered on its own :)
 
Last edited:
Top Bottom