Remitur Posted November 16, 2020 Share Posted November 16, 2020 Problem: I'm writing a widget for admin area this widget need to call a function, defined in a registrar module (i.e. MyCustomRegistrarModule_myfunction() ) If I call it directly inside the widget, I'm obviously getting a "nice "Oops!" message ("Error: Call to undefined function WHMCS\Module\Widget\MyCustomRegistrarModule_myfunction()") I could replicate the function inside the widget, redefining it, but I guess that there's some kind of better and smarter way to do it... 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 16, 2020 Share Posted November 16, 2020 Include once includes/registrarfunctions.php and then call the module function via MyCustomRegistrarModule_myfunction($params) ; registrarfunctions.php should be loading the registrar modules and the function will then be available. Just do a function_exists check first . 1 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.