I want to make a template like something $NAME$ other $LOWNAME$
so that when I use it, I'm taken to $NAME$ input list and $LOWNAME$ is automatically filled with decapitalized value of $NAME$ I input. For example, I print "Client" to $NAME$ and the value of $LOWNAME$ is "client". Is this possible?
An ERB template can reference variables like food before they're defined. When you call ERB#result, or ERB#run, the template is executed according to the current values of those variables. Like JSP and PHP code, ERB templates can contain loops and conditionals.
To configure live templates, open the Editor | Live Templates page of the IDE settings Ctrl+Alt+S . On the Live Templates page, you can see all the available live templates, edit them and create new templates. To make finding and editing templates easier, they are split into groups.
If by "decapitalizing" you mean to lower case only first letter then YES, otherwise No (as there is no function for lower casing all characters).
something $NAME$ other $LOWNAME$
decapitalize(NAME)
and tick/check "Skip if defined" boxNow when template will be expanded, and if you enter "CapitalShip" for $NAME$
variable, the
$LOWNAME$
will automatically become "capitalShip"
http://www.jetbrains.com/phpstorm/webhelp/edit-template-variables-dialog.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With