mfoland Posted March 21, 2019 Share Posted March 21, 2019 Hello, I made a Square Gateway, which is in the Marketplace. The issue right now, is it's coded with PHP, and has to rely on allowing it to run with the php smarty tags, which aren't recommended. Is there an alternative way to avoid Smarty PHP tags? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 21, 2019 Share Posted March 21, 2019 4 minutes ago, mfoland said: The issue right now, is it's coded with PHP, and has to rely on allowing it to run with the php smarty tags, which aren't recommended. Is there an alternative way to avoid Smarty PHP tags? yes - either do it in PHP (e.g hooks) or Smarty in the templates... never using {php} in the templates. 0 Quote Link to comment Share on other sites More sharing options...
mfoland Posted March 21, 2019 Author Share Posted March 21, 2019 Can we discuss this over Skype? Smarty sucks lol so I guess I’ll have to convert to a hook! 0 Quote Link to comment Share on other sites More sharing options...
mfoland Posted March 21, 2019 Author Share Posted March 21, 2019 22 minutes ago, brian! said: yes - either do it in PHP (e.g hooks) or Smarty in the templates... never using {php} in the templates. @brian! https://developers.whmcs.com/hooks/module-hooks/ Can I name it a custom page like square_hooks.php so I can encode it to protect the code? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 21, 2019 Share Posted March 21, 2019 2 minutes ago, mfoland said: Can I name it a custom page like square_hooks.php so I can encode it to protect the code? I think it has to be called hooks.php - but there's nothing to stop you encoding it to protect your code. 0 Quote Link to comment Share on other sites More sharing options...
mfoland Posted March 21, 2019 Author Share Posted March 21, 2019 1 minute ago, brian! said: I think it has to be called hooks.php - but there's nothing to stop you encoding it to protect your code. @brian! My thing is what are the odds of someone wanting to develop some hooks after purchasing my module and then they overwrite hooks.php then the hooks are gone lol. See my dilemma lol 0 Quote Link to comment Share on other sites More sharing options...
mfoland Posted March 21, 2019 Author Share Posted March 21, 2019 @brian! It appears to not have to be hooks.php as long as it's in the hooks folder 🙂 0 Quote Link to comment Share on other sites More sharing options...
mfoland Posted March 21, 2019 Author Share Posted March 21, 2019 @brian! I stand corrected.. A hook for a module has to go inside modules then hooks.php 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 21, 2019 Share Posted March 21, 2019 That is only for addon modules and maybe server modules (don't recall right off) but gateway modules aren't setup the same way unfortunately and so any hooks you need for an actual gateway module in the gateways folder need to go in to the includes/hooks folder. So did you do an actual gateway module or an addon module for Square? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted March 21, 2019 Share Posted March 21, 2019 (edited) In your hooks.php include custom_hooks.php if custom_hooks.php file exists. This way if someone wants to add additional hooks he can simply create custom_hooks.php that will be automatically included by your encoded hooks.php. Edited March 21, 2019 by Kian 0 Quote Link to comment Share on other sites More sharing options...
mfoland Posted March 23, 2019 Author Share Posted March 23, 2019 On 3/21/2019 at 1:29 PM, steven99 said: That is only for addon modules and maybe server modules (don't recall right off) but gateway modules aren't setup the same way unfortunately and so any hooks you need for an actual gateway module in the gateways folder need to go in to the includes/hooks folder. So did you do an actual gateway module or an addon module for Square? I did! It's for Square, and I'm working on making it not use the smarty tags. I'm new to hooks, so this part is new to me. 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.