I create a snippet for my PHP laravel in SBT3
<snippet>
<content><![CDATA[
dd("${1}",${1});
]]></content>
<tabTrigger>dd</tabTrigger>
<scope>source.php</scope>
</snippet>
When I typed dd
I see this now.
if I type more
notice it's wrong ?
It need have the $
like this
dd("nameofTheVariable",$nameofTheVariable);
How do I modify my snippet to escape the $
?
The nameofTheVariable
is stored in ${1}
, so you'll need to add another $
before it.
Use a backslash (\
) to escape it: dd("${1}",\$${1});
<snippet>
<content><![CDATA[
dd("${1}", \$${1});
]]></content>
<tabTrigger>dd</tabTrigger>
<scope>source.php</scope>
</snippet>
Note: I've placed a space (
) after the comma (,
) as PSR-2 prefers it.