Jump to content
  • 0

Read paramenters from a module


fossxplorer

Question

I'd like to know how i can read in different parameters before provisiong a product.

in WHMCS it was done as following:

$fullname = $params["clientsdetails"]["firstname"] . " " . $params["clientsdetails"]["lastname"];
$email = $params["clientsdetails"]["email"];
$myusername = $params["clientsdetails"]["customfields1"];
$mypassword = $params["password"];
$pid = $params["pid"];  //Product/Service ID

Thanks.

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
32 minutes ago, fossxplorer said:

I'd like to know how i can read in different parameters before provisiong a product.

in WHMCS it was done as following:

$fullname = $params["clientsdetails"]["firstname"] . " " . $params["clientsdetails"]["lastname"];
$email = $params["clientsdetails"]["email"];
$myusername = $params["clientsdetails"]["customfields1"];
$mypassword = $params["password"];
$pid = $params["pid"];  //Product/Service ID

Thanks.

 

 

Where are you planning on running this code? In a plugin? In a module? 

More information here: https://docs.blesta.com/display/dev/Overview

-Adam

Link to comment
Share on other sites

  • 0

I Thanks @activa.

I fail to see what the array $var contains reading https://docs.blesta.com/display/dev/Module+Methods#ModuleMethods-addService($package,array$vars=null,$parent_package=null,$parent_service=null,$status="pending")

But i might get an overview by dumping the $var perhaps and see i guess.

Also, i need to read in a custom field "username". Is that also something i can do through $var?

 

 

 

 

Link to comment
Share on other sites

  • 0
5 hours ago, fossxplorer said:

I Thanks @activa.

I fail to see what the array $var contains reading https://docs.blesta.com/display/dev/Module+Methods#ModuleMethods-addService($package,array$vars=null,$parent_package=null,$parent_service=null,$status="pending")

But i might get an overview by dumping the $var perhaps and see i guess.

Also, i need to read in a custom field "username". Is that also something i can do through $var?

 

http://source-docs.blesta.com/class-Module.html#_addService

If you click on the description for any function it will expand (its of course not made clear with the template/theme of the page).

 

-Adam

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
Answer this question...

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

Loading...
×
×
  • Create New...