phpstormapache-velocity

How can I add a slash before a dollar sign in a PhpStorm template file?


I'm trying to create a file template for PhpStorm that has a back-slash in front of a variable. This is for a json template used in magento development, but I would say that this issue is extension ambivalent:

Text in the template:

"Something\\${Variable_Name}\\"

I would like this to result in

"Something\\EnteredVariable\\"

But this is the results in this in the generated file:

"Something\EnteredVariable\\"

I've tried adding an extra dollar sign which results in:

"Somthing\$EnteredVariable\\"

and extra back slash, which results in:

"Something\${Variable_Name}"

an extra dollar sign and an extra back slash, which also results in:

"Something\${Variable_Name}"

I couldn't find the answer in any docs. Anyone have the answer?


Solution

  • Thank's to @LazyOne;

    The answer is to add a double backslash. To get "Something\\VanName\\"

    // to get "Something\\EnteredVariable\\" use
    "Somthing\\\\$Variable_Name"