Sublime Forum

Problem with PHP snippet stripping code

#1

I have a snippet:

[code]
<![CDATA[

<?= $this->load->view('fragment/stay_connected.php'); ?>

]]>

[/code]

However, when I run it, I lose the $this every time:

<?= ->load->view('fragment/stay_connected.php'); ?>

Am I missing something? Do I need to escape the $ somehow?

0 Likes

#2

Yes, you need to escape $ with a backslash:

\$this->
0 Likes

#3

[quote=“iamntz”]Yes, you need to escape $ with a backslash:

\$this->

thanks.

0 Likes