Jump to content

Get from addon module configuration


rev

Recommended Posts

Hi

 

I'm trying to understand how i can get a variable on clientarea page from my addon module configuration. I've seen in documentation that this is the way.

function my_custom_module_clientarea($vars) {

   $myvariable = $vars['myvariable'];

}	

While in my custom module i have the following:

function my_custom_mdoule_config() {
   $configarray = array(
   "name" => "My Module",
   "version" => "1.0",
   "author" => "My website",
   "description" => "Description",
   "language" => "english",
   "fields" => array(
       "myvariable" => array ("FriendlyName" => "myvariable", "Type" => "dropdown", "Options" => "1,2,3,4,5,6,7,8,9,10", "Description" => "This is my variable"),
   ));
   return $configarray;
}

function my_custom_module_output($vars) {

   $myvariable = $vars['myvariable'];  

}

It is not working. What's the right way?

Link to comment
Share on other sites

Thank you.

 

I don't want to pass the variable to a tpl file. Setup > Addon Modules. I can customize my module from this page. For example i have 2 fields: width, height. I want to pass these variables to my_script.php in this way:

<img src=something.png width=".$configarray['width']." height=".$configarray['height'].">

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