Jump to content

How to access registar module params in module hooks?


alankis

Recommended Posts

I have a registar module, which doesn't format telephone number according to a RFC XML EPP schema. I have created function, which checks phone number in $params["phonenumber"] and then format number accordingly. $params["fullphone"] number was not of use in my case. Now I want to format number, but not inside module file, because it will get rewritten in next update, so I put my code in hooks.php, and added a "PreDomainRegister" hook, which I have tested and hook is running fine. Problem, is that it seems, that I only can access module $params only from module file, which name is equal to module name. I have try dumping variable, and only thing I get out is

Array ( [domain] => domainname.com )

.

 

I have even try to return complete array back to hooks, but no luck:

 

myregistarmodule/myregistarmodule.php

 

{...}

 

function myregistarmodule_ReturntParams($params)

{

return $params;

}

 

 

And then retrieve them in my hooks.php file, but still not luck:

myregistarmodule/hooks.php

{...}

function hook_MyregistarmodulTest(array $params) {

$params = myregistarmodule_ReturntParams($params);

print_r($params);

}


add_hook("PreDomainRegister", 1, "hook_MyregistarmodulTest");

 

Is there any way for module paramaters to be avaliable to module hooks, or I have write queries inside my hooks?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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