General Introduction
Settings
Special constants
Special variables
Date and Time
Complex logic in filter
Email system
AddBufferContent
AddChainItem
AddHeadScript
AddHeadString
AddPanelButton
AddViewContent
AuthForm
CaptchaCheckCode
CaptchaGetCode
ConvertCharset
ConvertCharsetArray
CopyFileAccessPermission
GetCSS
GetCurDir
GetCurPage
GetCurPageParam
GetCurUri
GetDirProperty
GetDirPropertyList
GetException
GetFileAccessPermission
GetFileContent
GetFileRecursive
GetMenu
GetMenuHtml
GetMenuHtmlEx
GetMeta
GetNavChain
GetPageProperty
GetPagePropertyList
GetPanel
GetProperty
GetPublicShowMode
GetShowIncludeAreas
GetSiteByDir
GetTemplatePath
GetTitle
GetUserRight
GetUserRoles
IncludeAdminFile
IncludeComponent
IncludeFile
IncludeString
IsHTTPS
MoveJSToBody
RemoveFileAccessPermission
ResetException
SaveFileContent
SetAdditionalCSS
SetCurPage
SetDirProperty
SetFileAccessPermission
SetPageProperty
SetTemplateCSS
SetTitle
ShowBanner
ShowBodyScripts
ShowCSS
ShowHead
ShowHeadScripts
ShowHeadStrings
ShowMeta
ShowNavChain
ShowPanel
ShowProperty
ShowSpreadCookieHTML
ShowTitle
ShowViewContent
ThrowException
get_cookie
set_cookie
Features
AddHeadString
CMain::AddHeadString( str, bool Unique=false, additional=false, location = AssetLocation::AFTER_JS_KERNEL )
The method adds a string into the <head>…</head> section of a site. Non-static method.
Equivalent to the method \Bitrix\Main\Page\Asset::addString in core D7.
Variables
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 | |
additional | Optional parameter. By default value is false. | |
location | Where to print the string. Possible values: BEFORE_CSS, AFTER_CSS, AFTER_JS_KERNEL, AFTER_JS, BODY_END. | 14.0.18 |
Examples
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-2023
Up