santoshlucid Posted March 14, 2013 Share Posted March 14, 2013 Hi, I am new for prestashop and i want to include php file in smarty template file. When i use {php} include("filename.php"); {/php} nothing to display on display area.... Please help me!! Regards Santosh Kumar Singh. Link to comment Share on other sites More sharing options...
Rahvin Posted March 14, 2013 Share Posted March 14, 2013 (edited) a 3 seconds google issue... {include file='page.tpl'} (http://www.smarty.ne...ion.include.tpl) But you don't include php-files in you template-files. Put your php-code in your controller. Edited March 14, 2013 by Rahvin (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted March 15, 2013 Share Posted March 15, 2013 it's better to add php functions classes etc in your module controller, {php} is depreciated for a reason as it allow poor practices. Smarty recommends putting the included script into the PHP logic (controllers,classes,functions) as i said - {php} tags are deprecated from Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin functions instead. 1 Link to comment Share on other sites More sharing options...
bluczka Posted October 10, 2017 Share Posted October 10, 2017 The reasons I am posting this question is I am new to prestashop Google is not helping me and/or my searching skills have degraded. I have code php : <?php require_once('themes/sp_furnicom/flow-flow/ff-injector.php'); $injector = new FFInjector(); ?> <?php echo $injector->head(true); ?> <?php $stream_id = isset($_REQUEST['stream']) ? $_REQUEST['stream'] : 1; $injector->stream($stream_id); ?> How can I change this to function? I want this code to be displayed on the same .tpl page that the controller has. I want this code to be displayed on the same .tpl page that the controller has. Link to comment Share on other sites More sharing options...
Recommended Posts