I have this variable $pagecontents in a PHP file. echo <<<EOF $pagecontents EOF; PHP: How can I call up its value in a TPL file? When I use {$pagecontent} in the TPL file, nothing shows. Is there some syntax that's missing? edit: Problem solved, needed to assign the variable. $gDirSmarty->assign('auto_keywords', $pagecontents);
Yes, you can also use $gDirSmarty->assign_by_ref('auto_keywords', $pagecontents); It can be better for performance and resources usage if variable value is large and you do not modify this variable anymore. Assign_by_ref makes reference to this var instead of making copy.