X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Parsing PHP in the templates (https://forum.x-cart.com/showthread.php?t=23537)

frankdux 07-24-2006 12:51 PM

Parsing PHP in the templates
 
Is it possible to parse PHP code in the templates? I don't mean just using includes. I realize you can do that with Smarty. I mean something that would require 5-10 lines of code to be parsed.

mocara 07-24-2006 01:42 PM

http://smarty.php.net/manual/en/language.function.php.php

Did you read the smarty docs? ;-)

Mocara.

frankdux 07-24-2006 02:07 PM

Thanks mocara. It's been a while since I messed with Smarty. The {php} tag works pretty well. I'll have to have a deeper look through the manual.

B00MER 07-24-2006 02:13 PM

Code:

{php}func_print_r($this->_tpl_vars);{/php}

Full list of smarty variables/arrays without debug console, yay! :)

also you can use $GLOBALS to grab any other data you may need. :wink:

:idea: Another tip is open up some files in templates_c/ and you can see how smarty converts it all into php anyway.


All times are GMT -8. The time now is 10:17 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.