ralphonz Posted February 13, 2014 Share Posted February 13, 2014 I'm really new to smarty. In fact the only time i've ever used it is when customising my WHMCS template. In the smarty documentation it clearly states: {php} tags are deprecated from Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin functions instead. However, I see loads of people on this forum using {php} tags and recommending their use to get round certain shortcomings in the WHMCS template system. I am currently using the {php} tags to assign extra variables not usually available on certain pages (to combine some of the client area pages). However, what will happen when {php} is finally dropped from smarty? It's very worrying. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 13, 2014 Share Posted February 13, 2014 WHMCS it self use {php} you can create action hook instead of using it 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted February 14, 2014 Share Posted February 14, 2014 It should be worrying but WHMCS has implemented Smarty version that uses {php}. If they update it to the latest, changelog should mention it for updating all the custom work in themes, by the user. WHMCS dev team will update source code in order to WHMCS work properly. Not other codes 0 Quote Link to comment Share on other sites More sharing options...
ralphonz Posted February 14, 2014 Author Share Posted February 14, 2014 WHMCS it self use {php}you can create action hook instead of using it Sorry I'm not sure I understand? What do you mean? Could you give me an example? It should be worrying but WHMCS has implemented Smarty version that uses {php}. If they update it to the latest, changelog should mention it for updating all the custom work in themes, by the user. WHMCS dev team will update source code in order to WHMCS work properly. Not other codes My concern is that if I write code now using {php} then WHMCS one day moves to use a smarty version with no {php} function then my template will break when I update WHCMS. So, my real question is what should I be doing instead of using {php} in order to future-proof my template? 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted February 14, 2014 Share Posted February 14, 2014 Always read changelog Always update on a non-live version of WHMCS Be prepared U can not prevent your code for not been updated in future WHMCS updates. This is a script that must been updated for many reasons. Like Smarty, PHP is been updating and removing old tags so everyone must follow the changes. PS: I dont think that WHMCS is going to update Smarty soon.... 0 Quote Link to comment Share on other sites More sharing options...
ralphonz Posted February 15, 2014 Author Share Posted February 15, 2014 [*]Be prepared Yeah I'm trying to be prepared by not using {php} smarty tags! But what is the alternative way to execute the same code while keeping all files that I change within in my custom template directory? I'd be grateful if anyone could share their knowledge on smarty to explain another way of using php code in WHMCS templates. Then I'd feel prepared 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 15, 2014 Share Posted February 15, 2014 @ralphonz as WHMCS files is Encoded you may use Action Hooks instead of {php} to code php scripts, add conditions, then pass your result to smarty templates 0 Quote Link to comment Share on other sites More sharing options...
ralphonz Posted February 15, 2014 Author Share Posted February 15, 2014 sent, Is there a list of available hooks? I couldn't seem to find it? Many thanks. - - - Updated - - - Ah, no worries I found it ;-) Thanks for the help everyone. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 15, 2014 Share Posted February 15, 2014 http://docs.whmcs.com/Hooks:System#ClientAreaPage 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.