vertigos Posted January 4, 2009 Share Posted January 4, 2009 Thx to sparky i've understood how smarty works and moved on with my personal project 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. 0 Quote Link to comment Share on other sites More sharing options...
merlinpa1969 Posted January 4, 2009 Share Posted January 4, 2009 {literal} code here {/literal} if im not mistaken 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted January 4, 2009 Share Posted January 4, 2009 {include file='your.php'} 0 Quote Link to comment Share on other sites More sharing options...
vertigos Posted January 4, 2009 Author Share Posted January 4, 2009 Literal is just for scripts. Include is messing up whmcs. PHP result is appearing on the top of the screen messing the logo 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 4, 2009 Share Posted January 4, 2009 {php} require("your.php"); {/php} 0 Quote Link to comment Share on other sites More sharing options...
vertigos Posted January 4, 2009 Author Share Posted January 4, 2009 (edited) Sparky you are so damn good. I love you How did you manage to find that? Your imagination rocks Any way to be able to use smarty values to the link ? For example require("your{userid).php") Edited January 4, 2009 by vertigos 0 Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 6, 2009 Share Posted January 6, 2009 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 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 6, 2009 Share Posted January 6, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
vertigos Posted January 9, 2009 Author Share Posted January 9, 2009 (edited) 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 January 9, 2009 by vertigos 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.