Home Download Buy Blog Forum Support

Problem with PHP snippet stripping code

Problem with PHP snippet stripping code

Postby handycam on Thu Oct 18, 2012 5:36 pm

I have a snippet:
Code: Select all
<snippet>
   <content><![CDATA[
<?= $this->load->view('fragment/stay_connected.php'); ?>
]]></content>
</snippet>


However, when I run it, I lose the $this every time:
Code: Select all
<?= ->load->view('fragment/stay_connected.php'); ?>


Am I missing something? Do I need to escape the $ somehow?
Mac OS 10.9.3
ST 3 (3059)
handycam
 
Posts: 271
Joined: Tue Jan 03, 2012 2:42 pm

Re: Problem with PHP snippet stripping code

Postby iamntz on Thu Oct 18, 2012 5:43 pm

Yes, you need to escape $ with a backslash:
Code: Select all
\$this->
iamntz
 
Posts: 918
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Problem with PHP snippet stripping code

Postby handycam on Thu Oct 18, 2012 6:41 pm

iamntz wrote:Yes, you need to escape $ with a backslash:
Code: Select all
\$this->


thanks.
Mac OS 10.9.3
ST 3 (3059)
handycam
 
Posts: 271
Joined: Tue Jan 03, 2012 2:42 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 19 guests