Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to concatenate existing variable and string in Template Variables Dialog (PhpStorm)

Tags:

phpstorm

I have a live template like this

<div>$name$: $id$</div>

Now I want to set the default value of $id$ to name + "_id".

But when I put the default value of $id$ as name + "_id", in the "Edit Template Variables Dialog", the autocomplete does not concatenate value of name and (string) "_id" together. It only uses the value of name and ignored the "_id" part (for default value of $id$).

How can I make the default value of $id$ as name + "_id" in my live templates?

like image 409
supersan Avatar asked May 30 '16 03:05

supersan


1 Answers

You can try to create a variable and concat the values into it. Something like:

#set( $your_var = $NAME + '_id')

<div>$name$: $your_var$</div>
like image 153
Carlos Avatar answered Oct 02 '22 06:10

Carlos