All Projects → barrelstrength → PhpStorm-Live-Templates-Craft-CMS

barrelstrength / PhpStorm-Live-Templates-Craft-CMS

Licence: other
PhpStorm Live Templates for Craft CMS

Projects that are alternatives of or similar to PhpStorm-Live-Templates-Craft-CMS

Twig Extensions
Twig extensions
Stars: ✭ 1,469 (+4220.59%)
Mutual labels:  twig, twig-extension
markdown-extra
Markdown extension for Twig
Stars: ✭ 83 (+144.12%)
Mutual labels:  twig, twig-extension
Craft
Composer starter project for Craft CMS
Stars: ✭ 122 (+258.82%)
Mutual labels:  twig, craftcms
phpstorm-settings
PhpStorm settings used for Craft CMS development.
Stars: ✭ 46 (+35.29%)
Mutual labels:  craftcms, phpstorm
DrupalTwigFood
Useful functions, filters for twig @ Drupal 8
Stars: ✭ 1 (-97.06%)
Mutual labels:  twig, twig-extension
Twig Deferred Extension
An extension for Twig that allows to defer block rendering.
Stars: ✭ 97 (+185.29%)
Mutual labels:  twig, twig-extension
Reactrenderer
Client and Server-side React rendering from PHP
Stars: ✭ 201 (+491.18%)
Mutual labels:  twig, twig-extension
Twig Cache Extension
Stars: ✭ 67 (+97.06%)
Mutual labels:  twig, twig-extension
cssinliner-extension
[DEPRECATED] CSS inliner support for Twig
Stars: ✭ 30 (-11.76%)
Mutual labels:  twig, twig-extension
Slugify
Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
Stars: ✭ 2,697 (+7832.35%)
Mutual labels:  twig, twig-extension
Cssinliner Extra
CSS Inliner support for Twig
Stars: ✭ 93 (+173.53%)
Mutual labels:  twig, twig-extension
breadcrumb-bundle
Symfony bundle for easy breadcrumbs management
Stars: ✭ 26 (-23.53%)
Mutual labels:  twig, twig-extension
String Extra
Unicode/String support for Twig
Stars: ✭ 92 (+170.59%)
Mutual labels:  twig, twig-extension
Markdown Extension
[DEPRECATED] Markdown support for Twig
Stars: ✭ 105 (+208.82%)
Mutual labels:  twig, twig-extension
Html Compress Twig
Twig extension for compressing HTML and inline CSS/JS using WyriHaximus/HtmlCompress
Stars: ✭ 72 (+111.76%)
Mutual labels:  twig, twig-extension
Idea Php Toolbox
Collections of tools and improvements to make PhpStorm a little bit better
Stars: ✭ 147 (+332.35%)
Mutual labels:  twig, phpstorm
Inky Extension
[DEPRECATED] Inky email template engine support for Twig
Stars: ✭ 57 (+67.65%)
Mutual labels:  twig, twig-extension
Awesome Twig
A curated list of amazingly awesome Twig extensions, snippets and tutorials
Stars: ✭ 63 (+85.29%)
Mutual labels:  twig, twig-extension
Cms
Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond.
Stars: ✭ 2,713 (+7879.41%)
Mutual labels:  twig, craftcms
craft-twig
Craft CMS Package for Atom
Stars: ✭ 17 (-50%)
Mutual labels:  twig, craftcms

PhpStorm Live Templates for Craft CMS

Twig and PHP PhpStorm Live Templates for Craft CMS 3.

The Craft CMS Live Templates include various snippets for Craft-specific Twig tags and some other common use cases. Best when paired with Twig - Extended - a more extensive library of PhpStorm Live Templates for Twig.

Craft CMS - Twig

Craft Twig Tags (via tab trigger)

// Examples
asset                    craft.assets.first()
assets                   craft.assets loop
categories               craft.categories loop
entries                  craft.entries loop
feed                     craft.feeds.getFeedItems loop
matrix, matrixif         Basic Matrix field loop using if statements
matrixifelse             Basic Matrix field loop using if/elseif
matrixswitch             Basic Matrix field loop using switch
paginate                 Outputs example of pagination and prev/next links
tags                     craft.tags loop
users                    craft.users loop

// Output Helpers
cache                    {% cache %}...{% endcache %}
csrf                     {{ csrfInput() }}
children                 {% children %}
exit                     {% exit 404 %}
ifchildren               {% ifchildren %}...{% endifchildren %}
hook                     {% hook "$NAME$" %}
nav                      {% nav item in items %}...{% endnav %}
redirect                 {% redirect 'login' %}
redirectinput            {{ redirectInput($URL$) }}
requirelogin             {% requireLogin %}
requirepermission        {% requirePermission "spendTheNight" %}
switch                   {% switch variable %}...{% endswitch %}

css                      {% css %}...{% endcss %}
js                       {% js %}...{% endjs %}
registercssfile          {% do view.registerCssFile("css/style.css") %}
registerjsfile           {% do view.registerJsFile("js/script.js") %}

header                   {% header "string" %}
beginBody                {{ beginBody() }}
endbody                  {{ endBody() }}
head                     {{ head() }}

// Closing tags
case                     {% case "value" %}
endcache                 {% endcache %}
endifchildren            {% endifchildren %}
endcss                   {% endcss %}
endjs                    {% endjs %}
endnav                   {% endnav %}

// craft.app
app                      craft.app.[CURSOR]
config                   craft.app.config.general.[CURSOR]
ismultisite              craft.app.isMultiSite
language                 craft.app.language
locale                   craft.app.locale

// craft.app.request
getparam                 craft.app.request.getParam("name")
getbodyparam             craft.app.request.getBodyParam("name")
getqueryparam            craft.app.request.getQueryParam("name")
getsegment               craft.app.request.getSegment(1)

// craft.app.i18n
alllocales               craft.app.i18n.allLocales
applocales               craft.app.i18n.appLocales
editablelocaleids        craft.app.i18n.editableLocaleIds
editablelocales          craft.app.i18n.editableLocales
getlocalebyid            craft.app.i18n.getLocaleById($ID$)
primarysitelocale        craft.app.i18n.primarySiteLocale
sitelocaleids            craft.app.i18n.siteLocaleIds
sitelocales              craft.app.i18n.siteLocales

Craft Twig Functions (via tab trigger)

alias                    alias("@baseUrl/images/image.png")
ceil                     ceil()
classname                className(object)
clone                    clone(object)
floor                    floor()
getenv                   getenv('name')
max                      max()
min                      min()
round                    round()
shuffle                  shuffle()
svg                      svg('path')
url, urla                url('path'), url('path', params, 'https', false)
siteurl, siteurla        siteUrl('path'), siteUrl('path', params, 'https', 1)

Craft CMS - PHP

Migrations (via tab trigger)

migrate                  A basic migration class

Debugging (via tab trigger)

dd                       Craft::dd("Dump & Die");

Installation

  1. Go to PhpStorm Preferences | Tools | Settings Repository
  2. Add Read-only Source https://github.com/barrelstrength/PhpStorm-Live-Templates-Craft-CMS
  3. Restart PhpStorm

Visit Preferences->Editor->Live Templates and ensure that the Craft CMS - Twig and Craft CMS - PHP Live Templates are enabled, as desired.

  • Craft CMS - Twig.xml
  • Craft CMS - PHP.xml

Maintenance & Contributions

If you'd like to contribute to the Craft CMS Live Templates, please consider submitting a pull request, reporting an issue, providing examples of how you would like to see the behavior of the Live Templates improved, or just sending your thoughts.

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].