Creating a variable with $ sign in front in PHP file template


I have what should be a really easy thing to do, but I'm stumped. I've created a simple PHP file template that is meant to create within the Class a static array to hold all the instances of the array. For simplicity sake, I'm creating a class called State which will have a static array to hold all of the State instances.

I want the end result to be

     public static $StateList = array();

I first tried the following:

    public static ${NAME}List = array();

But that produced:

     public static StateList = array();

I've tried $${NAME}List, \$${NAME}, $\${NAME} but none of those work.

How do I do this simple task? (I'm using PHP 2018.1.6 on the Mac).



1 comment

Hi there,

${NAME} suggests that it's a File Template. If I'm correct -- just use ${DS} predefined variable.


P.S. In Live Templates that would be $$


Please sign in to leave a comment.