Dipta Dhar Posted November 12, 2020 Share Posted November 12, 2020 myModule.php: function myModule_ConfigOptions(array $params) { $conf = array( /* configoption1 */ "protocol" => array( "FriendlyName" => "Protocol Type", "Type" => "dropdown", "Options" => "http,https", "Size" => "25", "Description" => "enter protocol type"), /* configoption2 */ "host" => array( "FriendlyName" => "Host Name", "Type" => "text", "Size" => "25", "Description" => "enter host name address", "Default" => "127.0.0.1") ); return $conf; } hooks.php: <?php add_hook('...........', $priority, function($vars) { $protocol = <....?....>["configoption1"]; $host = <....?....>["configoption2"]; /* How can you received configoption options data in modules hook. */ } ?> NB: How can you received configoption options data in modules hook. 0 Quote Link to comment Share on other sites More sharing options...
Remitur Posted November 14, 2020 Share Posted November 14, 2020 On 11/12/2020 at 10:36 AM, Dipta Dhar said: NB: How can you received configoption options data in modules hook. You can't. It's crazy, but you can't do it directly and easily. The only way: recover the parameter value from the db, using something like this: $mymoduleparameter = Capsule::table('tbladdonmodules')->where('setting','mymoduleparameter')->value('value'); 1 Quote Link to comment Share on other sites More sharing options...
Dipta Dhar Posted November 15, 2020 Author Share Posted November 15, 2020 Thanks @Remitur 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 17, 2020 Share Posted November 17, 2020 Would be best to add on: ->where('module', $modulename ) to the query to limit to just your module. 1 Quote Link to comment Share on other sites More sharing options...
Remitur Posted November 20, 2020 Share Posted November 20, 2020 On 11/17/2020 at 9:16 PM, steven99 said: Would be best to add on: ->where('module', $modulename ) to the query to limit to just your module. You're right! (I have the habit to name module variables as $ModulenameModulevariable , so it's almost impossible going wrong ... 😉 ) 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 20, 2020 Share Posted November 20, 2020 That is probably a good habit actually. 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.