Documentation

AddHeadString

CMain::AddHeadString(
 str, 
 bool Unique=false, 
 additional=false
)

The method adds a string into the <head>…</head> section of a site. Non-static method.

Variable

Parameter Description Available from version
str string to be added into the … section
Unique if set to true and such string is already added to the <head> section, it will be duplicated. If set to false, the string will be added to the <head> section without duplication check.

Duplication check (with specified parameter $bUnique = true) is performed via calculation of md5-cache from the string in /bitrix/modules/main/classes/general/main.php.

additional Optional parameter. By default value is false.

Example of use

Add a style.css style file from the current directory.

<?$APPLICATION->AddHeadString('<link href="'.$APPLICATION->GetCurDir().'"style.css";  type="text/css" rel="stylesheet" />',true)?>


© «Bitrix24», 2001-2022
Up