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
Parameter | Description | Version |
---|---|---|
$moduleId | Module ID. Required. | |
$name | Parameter name. Required. | |
$default | Returns default value, when the value is not specified. | |
$siteId | Site ID, when parameter value varies for different sites. |
Exceptions
Parameters
Parameter | Description | Version |
---|---|---|
$moduleId | Module ID. Required. | |
$name | Parameter name. Required. | |
$default | Returns 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. | |
$siteId | site ID when parameter value is different for various sites. |
Example
$size = Option::get("main", "max_file_size");
© «Bitrix24», 2001-2024