Development Guides Home >> Guide to the LiveAPI System >> LiveAPI Methods
Guide to the LiveAPI System - The cpanelprint() Method
The cpanelprint()
method returns a cPanel variable's value.
Warning:
-
We
deprecated
this method. We recommend that you use the UAPI
Variables::get_server_information
,Variables::get_session_information
, andVariables::get_user_information
functions. - Despite its name, this method does not print a value.
To return a hash reference of a cPanel variable's value, use the fetch()
method.
Example
LiveAPI PHP Class
// Retrieve the cPanel account's username.
$cpanel->cpanelprint('$user');
LiveAPI Perl Module
# Retrieve the cPanel account's username.
$cpliveapi->cpanelprint('$user');
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
variable |
string | A cPanel variable. | A valid cPanel variable. Surround this variable with single quotes ('' ). For a full list of cPanel variables, read our Guide to cPanel Variables. The single quotes in this example are required. The method does not interpolate them. Instead, it passes those quotes to cPanel's print function, which requires them in order to return the correct value. |
'$user' |
Returns
This method returns the cPanel variable's value as a string.