1

I am trying to set up sublime text 2 with PHP, but I am having some trouble getting the snippets to work. I have loaded a PHP project and see that the syntax is correctly set to PHP. When I go to preferences -> browse -> packages _>php , I can see a number of PHP snippets that I am unable to activate including $_files $_get ,$post. As far as I can tell, the tab trigger for these are '$_'

<snippet>
<content><![CDATA[\$_COOKIE['${1:variable}']]]></content>
<tabTrigger>$_</tabTrigger>
<scope>source.php</scope>
<description>COOKIE['…']</description>
</snippet>

but this does not generate any snippets being displayed, when I try it in a php file.

Can anyone give me advice on what to do next?

Thank you,

Bill.

1
  • 2
    I've done this twice now - Just leaving a note for future people who may come across this. Make sure the spelling on the file name is correct, e.g. it ends in .sublime-snippet Commented Dec 17, 2012 at 22:37

2 Answers 2

2

Works on my Sublime Text 2, but only within the <?php ?> tags, not just in a file called .php.

Typing "$_ + TAB" within <?php ?> tags gives a list of all the $_ Snippets COOKIE, FILES, ENV, etc...

My next steps would be:

  • Do other Snippets work?
  • Did you create a Snippet that could overrule the $_ ?
  • Re-install ;-)
Sign up to request clarification or add additional context in comments.

1 Comment

when I reinstalled it started to work - ? - I'm not sure why. Thank you
0

You enabled the source for php, you can only be call this snippet in your php file only.

  1. create new file and save as somename.php
  2. write <?php after
  3. type $_ and hit TAB or Ctrl + Space

It generates the snippet, lets happy coding.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.