RPS Posted January 17, 2008 Share Posted January 17, 2008 I'm trying to integrate WHMCS into our website and have a problem with trying to reuse a php file that is used throughout our template/website. Basically, I want to replace the following with the Smarty version of the code: <?php $variable="Something"; include("/home/usr/public_html/_includes/file.php"); ?> Here's my setup: In header.tpl I want to include file.php, however, it should set the value of $variable to {$companyname} - {$pagetitle} So file.php looks like this: <?php echo $variable; ?> header.tpl looks like this: {php}$page_title = {$companyname} - {$pagetitle}; include("/home/usr/public_html/_includes/file.php");{/php} Of course, this isn't the correct syntax. I don't believe this is possible with Smarty, but I just wanted to confirm first. 0 Quote Link to comment Share on other sites More sharing options...
RPS Posted January 17, 2008 Author Share Posted January 17, 2008 Here's the way to do it... {php}$page_title = $this->get_template_vars('companyname').$smarty_middle.$this->get_template_vars('pagetitle'); include("/home/usr/public_html/_includes/file.php");{/php} 0 Quote Link to comment Share on other sites More sharing options...
danielsmith89 Posted February 25, 2008 Share Posted February 25, 2008 Thank you so much! I've been looking for an answer to this for ages! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.