PhpStorm Live Template & Postfix Snippets

All "Data generation" Snippets

$date$

Get the current date.

$date$
<template name="$date$" value="'$date$'$END$" description="Generate the current date" toReformat="false" toShortenFQNames="true">
<variable name="date" expression="date(&quot;yyyy-MM-dd'T'HH:mm:ss.SSSz&quot;)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP Expression" value="true" />
</context>
</template>

Live template

$uuid$

Generate an UUID.

$uuid$
<template name="$uuid$" value="'$uuid$'$END$" description="Generate an UUID" toReformat="false" toShortenFQNames="true">
<variable name="uuid" expression="groovyScript(&quot;UUID.randomUUID().toString()&quot;) " defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP Expression" value="true" />
</context>
</template>

Live template