Documentation

GetOptionInt

int COption::GetOptionInt(
 string module_id,
 string name,
 mixed def = false,
 string site = false
)

The method returns returns numeric parameter option_id, belonging to module_id. If the site_id parameter is not specified, an attempt is made to find the numeric parameter option_id, belonging to module_id for the current site. If such parameter is unavailable, a parameter, general to all sites is returned. Static method.

Method - is the wrapper for the GetOptionString method.

Parameters

ParameterDescription Available from version
module_id Module ID. Length not more than 50 symbols.
name Parameter ID. Length not more than 50 symbols.
def The default value.
If the default_value is not specified, it will be taken from the array with the name ${module_id."_default_option"} specified in the /bitrix/modules/module_id/default_option.php file.
site Site ID for which the parameters will be returned. Optional parameter. False by default for the current site. If not specified - general for all sites)

See Also

Examples of use

<?
// get the "Default person in charge" 
// from the "Techsupport" module settings 
$RESPONSIBLE_USER_ID = COption::GetOptionInt("support", "DEFAULT_RESPONSIBLE_ID");
?>


© «Bitrix24», 2001-2024