Jump to content

Avoiding PHP Smarty


mfoland

Recommended Posts

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!

Link to comment
Share on other sites

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. naughty.gif

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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? 

Link to comment
Share on other sites

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 by Kian
Link to comment
Share on other sites

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.

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.

×
×
  • 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