nil2567 Posted August 30, 2012 Share Posted August 30, 2012 soory for sking but when I think I know I don't know nothing. One question: how do you use php inside a tpl? EX: <style type="text/css"> body{ background: <?php echo "black;"; ?> } </style> why that don't work? Link to comment Share on other sites More sharing options...
Dh42 Posted August 30, 2012 Share Posted August 30, 2012 By default smarty has php inside of templates turned off. http://www.prestashop.com/forums/topic/174234-problem-call-php-function-with-tpl/ Once you get it turned on, this is how you use it http://www.smarty.net/docsv2/en/language.function.php.tpl Link to comment Share on other sites More sharing options...
coeos.pro Posted August 30, 2012 Share Posted August 30, 2012 (edited) it's: <style type="text/css"> body{ background: {php} echo "black;"; {/php} } </style> but for security don't use php in smarty Edited August 30, 2012 by coeos.pro (see edit history) Link to comment Share on other sites More sharing options...
nil2567 Posted August 30, 2012 Author Share Posted August 30, 2012 (edited) ok, if I dont use that inside tpl becouse of security than I want to use inside a php module file? Ex: from inside function inside php module: <?php echo " <style> backgound:black; </style> "; Is there a way to do that in prestashop? Edited August 30, 2012 by nil2567 (see edit history) Link to comment Share on other sites More sharing options...
Dh42 Posted August 30, 2012 Share Posted August 30, 2012 Make the variable in the php file and the reference it through smarty Link to comment Share on other sites More sharing options...
Recommended Posts