Jump to content

Smart & PHP Include w/ $variable


RPS

Recommended Posts

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.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated