Portal Home > Knowledgebase > Articles Database > Inserting PHP/HTML in Smarty


Inserting PHP/HTML in Smarty




Posted by evsion, 03-29-2008, 02:30 AM
Hi guys, I have the following code I want to INSERT in smarty...anyone would be willing to help out or know how to insert this? {php} {/php} isnt working for me.

Posted by etogre, 03-29-2008, 02:44 AM
I've done a little bit of work with smarty. I've never actually put code in my template files like this, but from the documentation you should do something such as Just my guess, because when you call a variable within a template file you have to declare it as global. I'm not sure how that would affect statically accessing a class's method like that, but since you're having issues it's obviously a problem. Is there anyway you can process this code first and then assign it to smarty? This might help: http://www.smarty.net/manual/en/vari...p.handling.php Maybe assign it as SMARTY_PHP_ALLOW Last edited by etogre; 03-29-2008 at 02:48 AM.

Posted by evsion, 03-29-2008, 03:00 AM
Thanks! I'm experimenting with different things but have YET to try this approach. It does make sense from reading the .docs but will see if it works. I'll try this approach and report back. (If I don't fall asleep..)

Posted by evsion, 03-29-2008, 03:28 AM
OK. This approach seemed to work: BUT I get the following error message: Strict Standards: Non-static method SimplePie_Misc::get_element() should not be called statically, assuming $this from incompatible context in /home/php/simplepie.inc on line 13264 Any ideas?

Posted by etogre, 03-29-2008, 12:04 PM
Can you paste a snippet of that class? Sounds like you forgot to label the method as static. or the lazy way (since it is a strict warning)



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
htaccess error (Views: 483)
Advanced Rack (Views: 492)