Documentation

get

Description

string public static
\Bitrix\Main\Config\Option::get(
 string $moduleId,
 string $name,
 string $default = "",
 boolean|string $siteId = false
);

This static method returns parameter value.

Similar to the methods COption::GetOptionInt and COption::GetOptionString in the old core.

Parameters

ParameterDescriptionVersion
$moduleIdModule ID. Required.
$nameParameter name. Required.
$defaultReturns default value, when the value is not specified.
$siteIdSite ID, when parameter value varies for different sites.

Exceptions

Parameters

ParameterDescriptionVersion
$moduleIdModule ID. Required.
$nameParameter name. Required.
$defaultReturns default value, if value is not set.
Default value.
When default_value is not set, sources the value from array with name ${module_id."_default_option"} specified in the file /bitrix/modules/module_id/default_option.php.
$siteIdsite ID when parameter value is different for various sites.

Example

$size = Option::get("main", "max_file_size");


© «Bitrix24», 2001-2024
Up