Jump to content

How to include a php file inside tpl


vertigos

Recommended Posts

Thx to sparky i've understood how smarty works and moved on with my personal project :D

Now the next thing that i've stuck at is how to include a php file inside the template :/ Lets say for example that i want to implement a forum within the whmcs template

Tried different combinations but with no success.

But i would like to be able to use smarty within the php tags of the include file. :)

Link to comment
Share on other sites

Although {php} {/php} is perfectly legal way to include php script into a smarty system. Smarty recommends not doing it that way. You can create script within the smarty system, as a smarty mod, that allows you to use smarty values instead of php within you tpl file... I have not completely got this process down yet, but it is there, and hopefully will completely understand how it works.

 

 

Anyone have little more insite, please post it. Thanks

Link to comment
Share on other sites

Although {php} {/php} is perfectly legal way to include php script into a smarty system. Smarty recommends not doing it that way. You can create script within the smarty system, as a smarty mod, that allows you to use smarty values instead of php within you tpl file... I have not completely got this process down yet, but it is there, and hopefully will completely understand how it works.

 

 

Anyone have little more insite, please post it. Thanks

Yes thats right... smarty recomends to put the php in the php file and the html in the tpl

Unfortunatly we don't have access to the encoded php file so there is no choice in the matter.

Link to comment
Share on other sites

I do not want to put it on an existing file.

I've created a new page. Tryied to put it inside php but didn't work. It was just returning the header and then blank page. :/

 

Tryied once again to put it under

require("init.php");

 

And before

require("display.php");

and the msg that i put appeared on the upper right corner.

Edited by vertigos
Link to comment
Share on other sites

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