Jump to content

include php file in .tpl file


Recommended Posts

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.

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

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

×
×
  • Create New...