triadwebzone Posted August 2, 2010 Share Posted August 2, 2010 I'm relatively new to making WHMCS addons, though I've been dealing with our WHMCS since I started. I'd like to know if it's possible to use a template to display my addon's data, rather than coding stuff up in the PHP file. Thanks! --Lisa 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted August 2, 2010 Share Posted August 2, 2010 I found the easiest way was to do a php include on within the template file. for example, say you have stuff in "test.php" that you want to display on the affiliate page. You would modify affiliates.tpl and add the following: {php} include('test.php'); {/php} There might be a better way of doing it, but this is what I've found 0 Quote Link to comment Share on other sites More sharing options...
triadwebzone Posted August 3, 2010 Author Share Posted August 3, 2010 (edited) I found the easiest way was to do a php include on within the template file. for example, say you have stuff in "test.php" that you want to display on the affiliate page. You would modify affiliates.tpl and add the following: {php} include('test.php'); {/php} There might be a better way of doing it, but this is what I've found Great, thank you. I wasn't sure if having a template file as the main file in my addon would work or not, but if it works for you, I'll give it a try. Edited August 3, 2010 by triadwebzone 0 Quote Link to comment Share on other sites More sharing options...
triadwebzone Posted August 3, 2010 Author Share Posted August 3, 2010 Ok, apparently that didn't work out so well. Any smarty tags I put in there just display as plain text. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted August 4, 2010 Share Posted August 4, 2010 Ya, Smarty tags wont work inside of {php} tags I do not think. 0 Quote Link to comment Share on other sites More sharing options...
triadwebzone Posted August 4, 2010 Author Share Posted August 4, 2010 If I have no other files in my addon besides a template file, and I put a smarty tag in that file, all I get is a display of the tag, not what the tag represents. For example, if I were to put {php}Some Code Here{/php} in my template file, all that would display on the screen would be {php}Some Code Here{/php} instead of what the code is told to output. See my problem? 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.