Documentation

Mage_Adminhtml_Block_Page_Head extends Mage_Page_Block_Html_Head
in package

Base Content Block class

Table of Contents

Constants

CACHE_GROUP  : mixed = 'block_html'
Cache group Tag
CACHE_KEY_PREFIX  : mixed = 'BLOCK_'
Prefix for cache key
CACHE_TAGS_DATA_KEY  : mixed = 'cache_tags'
Cache tags data key
XML_PATH_DEBUG_TEMPLATE_HINTS  : mixed = 'dev/debug/template_hints'
XML_PATH_DEBUG_TEMPLATE_HINTS_ADMIN  : mixed = 'dev/debug/template_hints_admin'
XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS  : mixed = 'dev/debug/template_hints_blocks'
XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS_ADMIN  : mixed = 'dev/debug/template_hints_blocks_admin'
XML_PATH_TEMPLATE_ALLOW_SYMLINK  : mixed = 'dev/template/allow_symlink'

Properties

$_alias  : string
Short alias of this block that was referred from parent
$_anonSuffix  : string
Suffix for name of anonymous block
$_app  : Mage_Core_Model_App|null
Application instance
$_baseUrl  : mixed
$_childGroups  : array<string|int, mixed>
Arbitrary groups of child blocks
$_children  : array<string|int, Mage_Core_Block_Abstract>
Contains references to child block objects
$_childrenHtmlCache  : array<string|int, mixed>
Children blocks HTML cache array
$_data  : array<string|int, mixed>|null
Object attributes
$_dirty  : array<string|int, mixed>
$_factory  : Mage_Core_Model_Factory|null
Factory instance
$_frameCloseTag  : string
Block html frame close tag
$_frameOpenTag  : string
Block html frame open tag
$_hasDataChanges  : bool
Data changes flag (true after setData|unsetData call)
$_idFieldName  : string
Name of object id field
$_isAnonymous  : bool
Whether this block was not explicitly named
$_isDeleted  : bool
Object delete flag
$_jsUrl  : mixed
$_layout  : Mage_Core_Model_Layout
Parent layout of the block
$_messagesBlock  : Mage_Core_Block_Messages|null
Messages block instance
$_nameInLayout  : string
Block name in layout
$_oldFieldsMap  : array<string|int, mixed>
Map short fields names to its full names
$_parent  : Mage_Core_Block_Abstract
Parent block
$_parentBlock  : Mage_Core_Block_Abstract
Parent block
$_request  : Mage_Core_Controller_Request_Http
Request object
$_showTemplateHints  : mixed
$_showTemplateHintsAdmin  : mixed
$_showTemplateHintsBlocks  : mixed
$_showTemplateHintsBlocksAdmin  : mixed
$_sortedChildren  : array<string|int, mixed>
Sorted children list
$_sortInstructions  : array<string|int, mixed>
Array of block sort priority instructions
$_syncFieldsMap  : mixed
Map of fields to sync to other fields upon changing their data
$_template  : string
Path to template file in theme.
$_translationHelper  : Mage_Core_Helper_Abstract|null
Translation helper instance
$_underscoreCache  : array<string|int, mixed>
Setter/Getter underscore transformation cache
$_urlModel  : Mage_Core_Model_Url
Url object
$_viewDir  : string
View scripts directory
$_viewVars  : array<string|int, mixed>
Assigned variables for view

Methods

__()  : string
Translate block sentence
__call()  : mixed
Set/Get attribute wrapper
__construct()  : mixed
Initialize factory instance
__get()  : mixed
Attribute getter (deprecated)
__set()  : mixed
Attribute setter (deprecated)
__toArray()  : array<string|int, mixed>
Convert object attributes to array
addCacheTag()  : $this
Add tag to block
addCss()  : $this
Add CSS file to HEAD entity
addData()  : $this
Add data to the object.
addItem()  : $this
Add HEAD Item
addJs()  : $this
Add JavaScript file to HEAD entity
addLinkRel()  : $this
Add Link element to HEAD entity
addModelTags()  : $this
Add tags from specified model to current block
addToChildGroup()  : mixed
Make sure specified block will be registered in the specified child groups
addToParentGroup()  : $this
Add self to the specified group of parent block
append()  : $this
Append child block
assign()  : $this
Assign variable
countChildren()  : int
Get children blocks count
debug()  : string|array<string|int, mixed>
Present object data as string in debug mode
escapeHtml()  : ($data is array ? ?string[] : ?string)
Escape html entities
escapeHtmlArrayAsObject()  : array<string|int, Mage_Core_Model_Security_HtmlEscapedString>
Wrapper for escapeHtml() function with keeping original value
escapeHtmlAsObject()  : Mage_Core_Model_Security_HtmlEscapedString
Wrapper for escapeHtml() function with keeping original value
escapeUrl()  : string
Escape html entities in url
fetchView()  : string
Retrieve block view from file (template)
flagDirty()  : $this
formatDate()  : string
Retrieve formatting date
formatTime()  : string
Retrieve formatting time
formatTimezoneDate()  : string
Retrieve formatting timezone date
getAction()  : Mage_Core_Controller_Varien_Action
Retrieve current action object
getAnonSuffix()  : string
Returns anonymous block suffix
getArea()  : string
Get design area
getBaseUrl()  : string
Get base url of the application
getBlockAlias()  : string
Returns block alias
getBlockHtml()  : string
Retrieve block html
getCacheKey()  : string
Get Key for caching block content
getCacheKeyInfo()  : array<string|int, mixed>
Get cache key informative items Provide string array key to share specific info item with FPC placeholder
getCacheLifetime()  : int|null
Get block cache lifetime
getCacheTags()  : array<string|int, mixed>
Get tags array for saving cache
getCanLoadWysiwyg()  : bool
getCharset()  : string
Retrieve Charset
getChild()  : mixed
Retrieve child block by name
getChildChildHtml()  : string
getChildData()  : mixed|void
Get a value from child block by specified key
getChildGroup()  : array<string|int, mixed>
Get a group of child blocks
getChildHtml()  : string
Retrieve child block HTML
getChunkedItems()  : array<string|int, mixed>
Retrieve Chunked Items
getContentType()  : string
Retrieve Content Type
getCssJsHtml()  : string
Get HEAD HTML with CSS/JS/RSS definitions (actually it also renders other elements, TODO: fix it up or rename this method)
getData()  : mixed
Object data getter
getDataByKey()  : mixed
Get object data by particular key
getDataByPath()  : mixed
Get object data by path
getDataSetDefault()  : mixed
Fast get data or set default if value is not available
getDataUsingMethod()  : mixed
Get object data by key with calling getter method
getDefaultTitle()  : string
Retrieve default title text
getDescription()  : string
Retrieve content for description tag
getDirectOutput()  : bool
Check if direct output is allowed for block
getFormKey()  : string
Retrieve Session Form Key
getHelper()  : Mage_Core_Block_Abstract
Return block helper
getHreflang()  : string
getIconDataUrl()  : string
getIconSvg()  : string
getId()  : mixed
Retrieve object id
getIdFieldName()  : string
Retrieve name of object id field
getIncludes()  : string
Get miscellaneous scripts/styles to be included in head before head closing tag
getIsAnonymous()  : bool
Check if block is using auto generated (Anonymous) name
getItemsTags()  : array<string|int, mixed>
Collect and retrieve items tags.
getJsUrl()  : string
Get url of base javascript file
getKeywords()  : string
Retrieve content for keyvords tag
getLayout()  : Mage_Core_Model_Layout
Retrieve layout object
getLoadingTimeout()  : int
Retrieve Timeout Delay from Config
getMediaType()  : string
Retrieve Media Type
getMessagesBlock()  : Mage_Core_Block_Messages
Retrieve messages block
getModuleName()  : string
Retrieve module name of block
getNameInLayout()  : string
Alias for getName method.
getObjectData()  : mixed
Get data from specified object
getParentBlock()  : self|null
Retrieve parent block
getPosition()  : string
getRequest()  : Mage_Core_Controller_Request_Http
Retrieve request object
getRobots()  : string
Retrieve URL to robots file
getShowTemplateHints()  : bool
getShowTemplateHintsAdmin()  : bool
getSkinUrl()  : string
Retrieve url of skins file
getSortedChildBlocks()  : array<string|int, Mage_Core_Block_Abstract>
Obtain sorted child blocks
getSortedChildren()  : array<string|int, mixed>
Retrieve sorted list of children.
getTemplate()  : string
Get relevant path to template
getTemplateFile()  : string
Get absolute path to template
getThemeTokensCss()  : string
The template renders this right after getCssJsHtml(), the only position that beats the skin's theme.css. addItem() cannot carry it: an inline style has no item type.
getTitle()  : string
Retrieve title element text (encoded)
getTranslationHelper()  : Mage_Core_Helper_Abstract
Helper getter for translations
getUrl()  : string
Generate url by route and parameters
getUrlBase64()  : string
Generate base64-encoded url by route and parameters
getUrlEncoded()  : string
Generate url-encoded url by route and parameters
getWysiwygPaletteCss()  : string
The storefront palette for the WYSIWYG preview, for the first store view of the CMS page or block being edited, else the default store view.
hasData()  : bool
If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
hasDataChanges()  : bool
Get data change status
hasWrapperMustBeVisible()  : bool
helper()  : Mage_Core_Helper_Abstract
Returns helper object
insert()  : object
Insert child block
isDeleted()  : bool
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
isDirty()  : bool
isEmpty()  : bool
checks whether the object is empty
isModuleEnabled()  : bool
isModuleOutputEnabled()  : bool
Check whether the module output is enabled
jsonDecode()  : mixed
Decodes the given $encodedValue string which is encoded in the JSON format
jsonEncode()  : string
Encode the mixed $valueToEncode into the JSON format
jsonSerialize()  : array<string|int, mixed>
Implementation of JsonSerializable::jsonSerialize()
jsQuoteEscape()  : mixed
Escape quotes in java scripts
offsetExists()  : bool
Implementation of ArrayAccess::offsetExists()
offsetGet()  : mixed
Implementation of ArrayAccess::offsetGet()
offsetSet()  : void
Implementation of ArrayAccess::offsetSet()
offsetUnset()  : void
Implementation of ArrayAccess::offsetUnset()
quoteEscape()  : string
Escape quotes inside html attributes Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc)
removeItem()  : $this
Remove Item from HEAD entity
renderView()  : string
Render block
serialize()  : string
serialize object attributes
setAdditionalHtml()  : $this
setAnonSuffix()  : $this
Set anonymous suffix for current block
setAttribute()  : $this
Set block attribute value
setBlockAlias()  : $this
Set block alias
setBlockParams()  : $this
setCacheKey()  : $this
setCacheLifetime()  : $this
setCacheTags()  : $this
setCanLoadCalendarJs()  : $this
setCanLoadWysiwyg()  : $this
setChild()  : $this
Set child block
setClass()  : $this
setContentHeading()  : $this
setData()  : $this
Overwrite data in the object.
setDataChanges()  : $this
Clears data changes status
setDataUsingMethod()  : $this
Set object data with calling setter method
setDescription()  : $this
setDestElementId()  : $this
setDisabled()  : $this
setDisplayMinimalPrice()  : $this
setFormAction()  : $this
setFrameTags()  : $this
Specify block output frame tags
setId()  : $this
Set object id field value
setIdFieldName()  : $this
set name of object id field
setIdSuffix()  : $this
setIsAnonymous()  : $this
Set the anonymous flag
setKeywords()  : $this
setLabel()  : $this
setLayout()  : $this
Set layout object
setMessagesBlock()  : $this
Set messages block
setNameInLayout()  : $this
Set block's name in layout and unsets previous link if such exists.
setOnclick()  : $this
setParentBlock()  : $this
Set parent block
setProduct()  : $this
setScriptPath()  : $this
Set template location directory
setTemplate()  : $this
setTitle()  : $this
Set title element text
setTranslationHelper()  : $this
Helper setter for translations
setType()  : $this
sortChildren()  : $this
Sort block's children
stripTags()  : string
Wrapper for standard strip_tags() function with extra functionality for html entities
toArray()  : array<string|int, mixed>
Public wrapper for __toArray
toHtml()  : string
Produce and return block's html output
toJson()  : string
Public wrapper for __toJson
toString()  : string
Public wrapper for __toString
toXml()  : string
Public wrapper for __toXml
unsetCallChild()  : $this
Call a child and unset it, if callback matched result
unsetChild()  : $this
Unset child block
unsetChildren()  : $this
Unset all children blocks
unsetData()  : $this
Unset data from the object.
unsetOldData()  : $this
Unset old fields data from the object.
__toJson()  : string
Convert object attributes to JSON
__toXml()  : string
Convert object attributes to XML
_addConfiguredFonts()  : void
The configured web font belongs to the storefront; the admin keeps its own.
_addFullNames()  : mixed
_addThemeFonts()  : void
Add the web fonts the active skin identity declares in its etc/theme.xml.
_afterToHtml()  : string
Processing block html after rendering
_beforeChildToHtml()  : mixed
Prepare child block before generate html
_beforeToHtml()  : $this
Before rendering html, but after trying to load cache
_camelize()  : string
_construct()  : void
Initialize template
_getApp()  : Mage_Core_Model_App
Retrieve application instance
_getChildHtml()  : string
Retrieve child block HTML
_getData()  : mixed
Get value from _data array without parse key
_getFactory()  : Mage_Core_Model_Factory
Retrieve factory instance
_getFormKeyPlaceholder()  : string
Get form key placeholder for cache
_getTagsCacheKey()  : string
Get cache key for tags
_getUrlModel()  : Mage_Core_Model_Url
Create and return url object
_getUrlModelClass()  : string
Returns url model class name
_initOldFieldsMap()  : mixed
Inits mapping array of object's previously used fields to new fields.
_isFile()  : bool
If DB file storage is on - find there, otherwise - just file_exists
_isSecure()  : bool
Checks is request Url is secure
_loadCache()  : string|false
Load block html from cache storage
_prepareArray()  : array<string|int, mixed>
Set required array elements
_prepareLayout()  : $this
Preparing global layout
_prepareOtherHtmlHeadElements()  : string
Render arbitrary HTML head items
_prepareStaticAndSkinElements()  : string
Merge static and skin files of the same format into 1 set of HEAD directives or even into 1 directive
_prepareSyncFieldsMap()  : $this
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
_saveCache()  : $this|false
Save block content to cache storage
_separateOtherHtmlHeadElements()  : mixed
Classify HTML head item and queue it into "lines" array
_sortItems()  : mixed
_toHtml()  : string
Render block HTML
_underscore()  : string
Converts field names for setters and getters

Constants

CACHE_GROUP

Cache group Tag

public mixed CACHE_GROUP = 'block_html'

CACHE_KEY_PREFIX

Prefix for cache key

public mixed CACHE_KEY_PREFIX = 'BLOCK_'

CACHE_TAGS_DATA_KEY

Cache tags data key

public mixed CACHE_TAGS_DATA_KEY = 'cache_tags'

XML_PATH_DEBUG_TEMPLATE_HINTS

public mixed XML_PATH_DEBUG_TEMPLATE_HINTS = 'dev/debug/template_hints'

XML_PATH_DEBUG_TEMPLATE_HINTS_ADMIN

public mixed XML_PATH_DEBUG_TEMPLATE_HINTS_ADMIN = 'dev/debug/template_hints_admin'

XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS

public mixed XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS = 'dev/debug/template_hints_blocks'

XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS_ADMIN

public mixed XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS_ADMIN = 'dev/debug/template_hints_blocks_admin'
public mixed XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink'

Properties

$_alias

Short alias of this block that was referred from parent

protected string $_alias

$_anonSuffix

Suffix for name of anonymous block

protected string $_anonSuffix

$_childGroups

Arbitrary groups of child blocks

protected array<string|int, mixed> $_childGroups = []

$_childrenHtmlCache

Children blocks HTML cache array

protected array<string|int, mixed> $_childrenHtmlCache = []

$_data

Object attributes

protected array<string|int, mixed>|null $_data = []

$_dirty

protected array<string|int, mixed> $_dirty

$_frameCloseTag

Block html frame close tag

protected string $_frameCloseTag

$_frameOpenTag

Block html frame open tag

protected string $_frameOpenTag

$_hasDataChanges

Data changes flag (true after setData|unsetData call)

protected bool $_hasDataChanges = false

$_idFieldName

Name of object id field

protected string $_idFieldName = null

$_isAnonymous

Whether this block was not explicitly named

protected bool $_isAnonymous = \false

$_isDeleted

Object delete flag

protected bool $_isDeleted = false

$_nameInLayout

Block name in layout

protected string $_nameInLayout

$_oldFieldsMap

Map short fields names to its full names

protected array<string|int, mixed> $_oldFieldsMap = []

$_showTemplateHints

protected static mixed $_showTemplateHints

$_showTemplateHintsAdmin

protected static mixed $_showTemplateHintsAdmin

$_showTemplateHintsBlocks

protected static mixed $_showTemplateHintsBlocks

$_showTemplateHintsBlocksAdmin

protected static mixed $_showTemplateHintsBlocksAdmin

$_sortedChildren

Sorted children list

protected array<string|int, mixed> $_sortedChildren = []

$_sortInstructions

Array of block sort priority instructions

protected array<string|int, mixed> $_sortInstructions = []

$_syncFieldsMap

Map of fields to sync to other fields upon changing their data

protected mixed $_syncFieldsMap = []

$_template

Path to template file in theme.

protected string $_template = ''

$_underscoreCache

Setter/Getter underscore transformation cache

protected static array<string|int, mixed> $_underscoreCache = []

$_viewDir

View scripts directory

protected string $_viewDir = ''

$_viewVars

Assigned variables for view

protected array<string|int, mixed> $_viewVars = []

Methods

__()

Translate block sentence

public __() : string
Return values
string

__call()

Set/Get attribute wrapper

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>

__construct()

Initialize factory instance

public __construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
$args : array<string|int, mixed> = []

__get()

Attribute getter (deprecated)

public __get(string $var) : mixed
Parameters
$var : string

__set()

Attribute setter (deprecated)

public __set(string $var, mixed $value) : mixed
Parameters
$var : string
$value : mixed

__toArray()

Convert object attributes to array

public __toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
$arrAttributes : array<string|int, mixed> = []

array of required attributes

Return values
array<string|int, mixed>

addCacheTag()

Add tag to block

public addCacheTag(string|array<string|int, mixed> $tag) : $this
Parameters
$tag : string|array<string|int, mixed>
Return values
$this

addCss()

Add CSS file to HEAD entity

public addCss(string $name[, string $params = '' ][, string $referenceName = '*' ][, bool $before = null ]) : $this
Parameters
$name : string
$params : string = ''
$referenceName : string = '*'
$before : bool = null
Return values
$this

addData()

Add data to the object.

public addData(array<string|int, mixed> $arr) : $this

Retains previous data in the object.

Parameters
$arr : array<string|int, mixed>
Return values
$this

addItem()

Add HEAD Item

public addItem(string $type, string $name[, string $params = null ][, string $cond = null ][, string $referenceName = '*' ][, string|bool $before = false ]) : $this

Allowed types:

  • js
  • js_css
  • skin_js
  • skin_css
  • rss
Parameters
$type : string
$name : string
$params : string = null
$cond : string = null
$referenceName : string = '*'

name of the item to insert the element before. If name is not found, insert at the end, * has special meaning (before all / before all)

$before : string|bool = false

If true insert before the $referenceName instead of after

Return values
$this

addJs()

Add JavaScript file to HEAD entity

public addJs(string $name[, string $params = '' ][, string $referenceName = '*' ][, bool $before = null ]) : $this
Parameters
$name : string
$params : string = ''
$referenceName : string = '*'
$before : bool = null
Return values
$this

addLinkRel()

Add Link element to HEAD entity

public addLinkRel(string $rel, string $href) : $this
Parameters
$rel : string

forward link types

$href : string

URI for linked resource

Return values
$this

addToParentGroup()

Add self to the specified group of parent block

public addToParentGroup(string $groupName) : $this
Parameters
$groupName : string
Return values
$this

assign()

Assign variable

public assign(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
Parameters
$key : string|array<string|int, mixed>
$value : mixed = null
Return values
$this

countChildren()

Get children blocks count

public countChildren() : int
Return values
int

debug()

Present object data as string in debug mode

public debug([mixed $data = null ][, array<string|int, mixed> &$objects = [] ]) : string|array<string|int, mixed>
Parameters
$data : mixed = null
$objects : array<string|int, mixed> = []
Return values
string|array<string|int, mixed>

escapeHtml()

Escape html entities

public escapeHtml(null|string|array<string|int, string> $data[, null|array<string|int, string> $allowedTags = null ]) : ($data is array ? ?string[] : ?string)
Parameters
$data : null|string|array<string|int, string>
$allowedTags : null|array<string|int, string> = null
Return values
($data is array ? ?string[] : ?string)

escapeHtmlArrayAsObject()

Wrapper for escapeHtml() function with keeping original value

public escapeHtmlArrayAsObject(array<string|int, string> $data[, array<string|int, string>|null $allowedTags = null ]) : array<string|int, Mage_Core_Model_Security_HtmlEscapedString>
Parameters
$data : array<string|int, string>
$allowedTags : array<string|int, string>|null = null
Return values
array<string|int, Mage_Core_Model_Security_HtmlEscapedString>

@see Mage_Core_Model_Security_HtmlEscapedString::getUnescapedValue()

escapeUrl()

Escape html entities in url

public escapeUrl(string $data) : string
Parameters
$data : string
Return values
string

fetchView()

Retrieve block view from file (template)

public fetchView(string $fileName) : string
Parameters
$fileName : string
Return values
string

flagDirty()

public flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
$field : string
$flag : bool = true
Return values
$this

formatTimezoneDate()

Retrieve formatting timezone date

public formatTimezoneDate([string|int|DateTimeInterface|null $date = null ][, string $format = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT ][, bool $withTime = false ][, bool $useTimezone = true ]) : string
Parameters
$date : string|int|DateTimeInterface|null = null
$format : string = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT
$withTime : bool = false
$useTimezone : bool = true
Return values
string

getAnonSuffix()

Returns anonymous block suffix

public getAnonSuffix() : string
Return values
string

getArea()

Get design area

public getArea() : string
Return values
string

getBaseUrl()

Get base url of the application

public getBaseUrl() : string
Return values
string

getBlockAlias()

Returns block alias

public getBlockAlias() : string
Return values
string

getBlockHtml()

Retrieve block html

public getBlockHtml(string $name) : string
Parameters
$name : string
Return values
string

getCacheKey()

Get Key for caching block content

public getCacheKey() : string
Return values
string

getCacheKeyInfo()

Get cache key informative items Provide string array key to share specific info item with FPC placeholder

public getCacheKeyInfo() : array<string|int, mixed>
Attributes
#[Override]
Return values
array<string|int, mixed>

getCacheLifetime()

Get block cache lifetime

public getCacheLifetime() : int|null
Return values
int|null

getCacheTags()

Get tags array for saving cache

public getCacheTags() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCanLoadWysiwyg()

public getCanLoadWysiwyg() : bool
Return values
bool

getCharset()

Retrieve Charset

public getCharset() : string
Return values
string

getChild()

Retrieve child block by name

public getChild([string $name = '' ]) : mixed
Parameters
$name : string = ''

getChildChildHtml()

public getChildChildHtml(string $name[, string $childName = '' ][, bool $useCache = true ][, bool $sorted = false ]) : string
Parameters
$name : string

Parent block name

$childName : string = ''

OPTIONAL Child block name

$useCache : bool = true

OPTIONAL Use cache flag

$sorted : bool = false

OPTIONAL @see getChildHtml()

Return values
string

getChildData()

Get a value from child block by specified key

public getChildData(string $alias[, string $key = '' ]) : mixed|void
Parameters
$alias : string
$key : string = ''
Return values
mixed|void

getChildGroup()

Get a group of child blocks

public getChildGroup(string $groupName[, string $callback = null ][, bool $skipEmptyResults = true ]) : array<string|int, mixed>

Returns an array of => or an array of => <callback_result> The callback currently supports only $this methods and passes the alias as parameter

Parameters
$groupName : string
$callback : string = null
$skipEmptyResults : bool = true
Return values
array<string|int, mixed>

getChildHtml()

Retrieve child block HTML

public getChildHtml([string $name = '' ][, bool $useCache = true ][, bool $sorted = false ]) : string
Parameters
$name : string = ''
$useCache : bool = true
$sorted : bool = false
Return values
string

getChunkedItems()

Retrieve Chunked Items

public getChunkedItems(array<string|int, mixed> $items[, string $prefix = '' ][, int $maxLen = 450 ]) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>
$prefix : string = ''
$maxLen : int = 450
Return values
array<string|int, mixed>

getContentType()

Retrieve Content Type

public getContentType() : string
Return values
string

getCssJsHtml()

Get HEAD HTML with CSS/JS/RSS definitions (actually it also renders other elements, TODO: fix it up or rename this method)

public getCssJsHtml() : string
Return values
string

getData()

Object data getter

public getData([string $key = '' ][, string|int $index = null ]) : mixed

If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data

If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.

Parameters
$key : string = ''
$index : string|int = null

getDataByKey()

Get object data by particular key

public getDataByKey(string $key) : mixed
Parameters
$key : string

getDataByPath()

Get object data by path

public getDataByPath(string $path) : mixed

Method consider the path as chain of keys: a/b/c => ['a']['b']['c']

Parameters
$path : string

getDataSetDefault()

Fast get data or set default if value is not available

public getDataSetDefault(string $key, mixed $default) : mixed
Parameters
$key : string
$default : mixed

getDataUsingMethod()

Get object data by key with calling getter method

public getDataUsingMethod(string $key[, mixed $args = null ]) : mixed
Parameters
$key : string
$args : mixed = null

getDefaultTitle()

Retrieve default title text

public getDefaultTitle() : string
Return values
string

getDescription()

Retrieve content for description tag

public getDescription() : string
Return values
string

getDirectOutput()

Check if direct output is allowed for block

public getDirectOutput() : bool
Return values
bool

getFormKey()

Retrieve Session Form Key

public getFormKey() : string
Attributes
#[Override]
Return values
string

getHreflang()

public getHreflang() : string
Return values
string

getIconDataUrl()

public getIconDataUrl(string $name[, string $variant = 'outline' ][, array<string|int, mixed> $attributes = [] ]) : string
Parameters
$name : string
$variant : string = 'outline'
$attributes : array<string|int, mixed> = []
Return values
string

getIconSvg()

public getIconSvg(string $name[, string $variant = 'outline' ][, string $role = 'none' ]) : string
Parameters
$name : string
$variant : string = 'outline'
$role : string = 'none'

ARIA role, see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles

Return values
string

getId()

Retrieve object id

public getId() : mixed

getIdFieldName()

Retrieve name of object id field

public getIdFieldName() : string
Return values
string

getIncludes()

Get miscellaneous scripts/styles to be included in head before head closing tag

public getIncludes() : string
Return values
string

getIsAnonymous()

Check if block is using auto generated (Anonymous) name

public getIsAnonymous() : bool
Return values
bool

getItemsTags()

Collect and retrieve items tags.

public getItemsTags(array<string|int, mixed>|Collection $items) : array<string|int, mixed>

Item should implement Mage_Core_Model_Abstract::getCacheIdTags method

Parameters
$items : array<string|int, mixed>|Collection
Return values
array<string|int, mixed>

getJsUrl()

Get url of base javascript file

public getJsUrl([string $fileName = '' ]) : string

To get url of skin javascript file use getSkinUrl()

Parameters
$fileName : string = ''
Return values
string

getKeywords()

Retrieve content for keyvords tag

public getKeywords() : string
Return values
string

getLoadingTimeout()

Retrieve Timeout Delay from Config

public getLoadingTimeout() : int
Tags
since
19.4.18

/ 20.0.16

Return values
int

getMediaType()

Retrieve Media Type

public getMediaType() : string
Return values
string

getModuleName()

Retrieve module name of block

public getModuleName() : string
Return values
string

getNameInLayout()

Alias for getName method.

public getNameInLayout() : string
Return values
string

getObjectData()

Get data from specified object

public getObjectData(DataObject $object, string $key) : mixed
Parameters
$object : DataObject
$key : string

getParentBlock()

Retrieve parent block

public getParentBlock() : self|null
Return values
self|null

getPosition()

public getPosition() : string
Return values
string

getRobots()

Retrieve URL to robots file

public getRobots() : string
Return values
string

getShowTemplateHints()

public getShowTemplateHints() : bool
Return values
bool

getShowTemplateHintsAdmin()

public getShowTemplateHintsAdmin() : bool
Return values
bool

getSkinUrl()

Retrieve url of skins file

public getSkinUrl([string $file = null ][, array<string|int, mixed> $params = [] ]) : string
Parameters
$file : string = null

path to file in skin

$params : array<string|int, mixed> = []
Return values
string

getSortedChildren()

Retrieve sorted list of children.

public getSortedChildren() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTemplate()

Get relevant path to template

public getTemplate() : string
Return values
string

getTemplateFile()

Get absolute path to template

public getTemplateFile() : string
Return values
string

getThemeTokensCss()

The template renders this right after getCssJsHtml(), the only position that beats the skin's theme.css. addItem() cannot carry it: an inline style has no item type.

public getThemeTokensCss() : string
Return values
string

getTitle()

Retrieve title element text (encoded)

public getTitle() : string
Return values
string

getUrl()

Generate url by route and parameters

public getUrl([string $route = '' ][, array<string|int, mixed> $params = [] ]) : string
Parameters
$route : string = ''
$params : array<string|int, mixed> = []
Return values
string

getUrlBase64()

Generate base64-encoded url by route and parameters

public getUrlBase64([string $route = '' ][, array<string|int, mixed> $params = [] ]) : string
Parameters
$route : string = ''
$params : array<string|int, mixed> = []
Return values
string

getUrlEncoded()

Generate url-encoded url by route and parameters

public getUrlEncoded([string $route = '' ][, array<string|int, mixed> $params = [] ]) : string
Parameters
$route : string = ''
$params : array<string|int, mixed> = []
Return values
string

getWysiwygPaletteCss()

The storefront palette for the WYSIWYG preview, for the first store view of the CMS page or block being edited, else the default store view.

public getWysiwygPaletteCss() : string
Return values
string

hasData()

If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.

public hasData([string $key = '' ]) : bool
Parameters
$key : string = ''
Return values
bool

hasDataChanges()

Get data change status

public hasDataChanges() : bool
Return values
bool

hasWrapperMustBeVisible()

public hasWrapperMustBeVisible() : bool
Return values
bool

insert()

Insert child block

public insert(Mage_Core_Block_Abstract|string $block[, string $siblingName = '' ][, bool $after = false ][, string $alias = '' ]) : object
Parameters
$block : Mage_Core_Block_Abstract|string
$siblingName : string = ''
$after : bool = false
$alias : string = ''
Return values
object

$this

isDeleted()

Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value

public isDeleted([bool $isDeleted = null ]) : bool
Parameters
$isDeleted : bool = null
Return values
bool

isDirty()

public isDirty([string $field = null ]) : bool
Parameters
$field : string = null
Return values
bool

isEmpty()

checks whether the object is empty

public isEmpty() : bool
Return values
bool

isModuleEnabled()

public isModuleEnabled([string|null $moduleName = null ][, string $helperAlias = 'core' ]) : bool
Parameters
$moduleName : string|null = null
$helperAlias : string = 'core'
Return values
bool

isModuleOutputEnabled()

Check whether the module output is enabled

public isModuleOutputEnabled([string|null $moduleName = null ][, string $helperAlias = 'core' ]) : bool

Because many module blocks belong to Adminhtml module, the feature "Disable module output" doesn't cover Admin area

Parameters
$moduleName : string|null = null
$helperAlias : string = 'core'
Return values
bool

jsonDecode()

Decodes the given $encodedValue string which is encoded in the JSON format

public jsonDecode(string $encodedValue[, bool $associative = true ]) : mixed
Parameters
$encodedValue : string
$associative : bool = true
Tags
see
Mage_Core_Helper_Data::jsonDecode()
throws
JsonException

jsonEncode()

Encode the mixed $valueToEncode into the JSON format

public jsonEncode(mixed $valueToEncode) : string
Parameters
$valueToEncode : mixed
Tags
see
Mage_Core_Helper_Data::jsonEncode()
Return values
string

jsonSerialize()

Implementation of JsonSerializable::jsonSerialize()

public jsonSerialize() : array<string|int, mixed>

Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:

  • If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
  • If a nested DataObject has a custom toJson() method, it's converted to JSON string
  • If a nested DataObject uses only the base implementations, it's excluded from output

This prevents infinite recursion and circular references when serializing object hierarchies.

Attributes
#[Override]
Return values
array<string|int, mixed>

jsQuoteEscape()

Escape quotes in java scripts

public jsQuoteEscape(mixed $data[, string $quote = '\'' ]) : mixed
Parameters
$data : mixed
$quote : string = '\''

quoteEscape()

Escape quotes inside html attributes Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc)

public quoteEscape(string $data[, bool $addSlashes = false ]) : string
Parameters
$data : string
$addSlashes : bool = false
Return values
string

removeItem()

Remove Item from HEAD entity

public removeItem(string $type, string $name) : $this
Parameters
$type : string
$name : string
Return values
$this

renderView()

Render block

public renderView() : string
Return values
string

serialize()

serialize object attributes

public serialize([array<string|int, mixed> $attributes = [] ][, string $valueSeparator = '=' ][, string $fieldSeparator = ' ' ][, string $quote = '"' ]) : string
Parameters
$attributes : array<string|int, mixed> = []
$valueSeparator : string = '='
$fieldSeparator : string = ' '
$quote : string = '"'
Return values
string

setAdditionalHtml()

public setAdditionalHtml(string $value) : $this
Parameters
$value : string
Return values
$this

setAnonSuffix()

Set anonymous suffix for current block

public setAnonSuffix(string $suffix) : $this
Parameters
$suffix : string
Return values
$this

setAttribute()

Set block attribute value

public setAttribute(array<string|int, mixed>|string $name[, mixed $value = null ]) : $this

Wrapper for method "setData"

Parameters
$name : array<string|int, mixed>|string
$value : mixed = null
Return values
$this

setBlockAlias()

Set block alias

public setBlockAlias(string $alias) : $this
Parameters
$alias : string
Return values
$this

setBlockParams()

public setBlockParams(array<string|int, mixed> $value) : $this
Parameters
$value : array<string|int, mixed>
Return values
$this

setCacheKey()

public setCacheKey(string $value) : $this
Parameters
$value : string
Return values
$this

setCacheLifetime()

public setCacheLifetime(int|false $value) : $this
Parameters
$value : int|false
Return values
$this

setCacheTags()

public setCacheTags(array<string|int, mixed> $value) : $this
Parameters
$value : array<string|int, mixed>
Return values
$this

setCanLoadCalendarJs()

public setCanLoadCalendarJs(bool $value) : $this
Parameters
$value : bool
Return values
$this

setCanLoadWysiwyg()

public setCanLoadWysiwyg(bool $value) : $this
Parameters
$value : bool
Return values
$this

setClass()

public setClass(string $value) : $this
Parameters
$value : string
Return values
$this

setContentHeading()

public setContentHeading(string $value) : $this
Parameters
$value : string
Return values
$this

setData()

Overwrite data in the object.

public setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this

$key can be string or array. If $key is string, the attribute value will be overwritten by $value

If $key is an array, it will overwrite all the data in the object.

Parameters
$key : string|array<string|int, mixed>
$value : mixed = null
Return values
$this

setDataChanges()

Clears data changes status

public setDataChanges(bool $value) : $this
Parameters
$value : bool
Return values
$this

setDataUsingMethod()

Set object data with calling setter method

public setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
$key : string
$args : mixed = []
Return values
$this

setDescription()

public setDescription(string $value) : $this
Parameters
$value : string
Return values
$this

setDestElementId()

public setDestElementId(string $value) : $this
Parameters
$value : string
Return values
$this

setDisabled()

public setDisabled(bool $value) : $this
Parameters
$value : bool
Return values
$this

setDisplayMinimalPrice()

public setDisplayMinimalPrice(bool $value) : $this
Parameters
$value : bool
Return values
$this

setFormAction()

public setFormAction(string $value) : $this
Parameters
$value : string
Return values
$this

setFrameTags()

Specify block output frame tags

public setFrameTags(string $openTag[, string $closeTag = null ]) : $this
Parameters
$openTag : string
$closeTag : string = null
Return values
$this

setId()

Set object id field value

public setId(mixed $value) : $this
Parameters
$value : mixed
Return values
$this

setIdFieldName()

set name of object id field

public setIdFieldName(string $name) : $this
Parameters
$name : string
Return values
$this

setIdSuffix()

public setIdSuffix(string $value) : $this
Parameters
$value : string
Return values
$this

setIsAnonymous()

Set the anonymous flag

public setIsAnonymous(bool $flag) : $this
Parameters
$flag : bool
Return values
$this

setKeywords()

public setKeywords(string $value) : $this
Parameters
$value : string
Return values
$this

setLabel()

public setLabel(string $value) : $this
Parameters
$value : string
Return values
$this

setNameInLayout()

Set block's name in layout and unsets previous link if such exists.

public setNameInLayout(string $name) : $this
Parameters
$name : string
Return values
$this

setOnclick()

public setOnclick(string $value) : $this
Parameters
$value : string
Return values
$this

setScriptPath()

Set template location directory

public setScriptPath(string $dir) : $this
Parameters
$dir : string
Return values
$this

setTemplate()

public setTemplate(string $value) : $this
Parameters
$value : string
Return values
$this

setTitle()

Set title element text

public setTitle(string $title) : $this
Parameters
$title : string
Return values
$this

setType()

public setType(string $value) : $this
Parameters
$value : string
Return values
$this

sortChildren()

Sort block's children

public sortChildren([bool $force = false ]) : $this
Parameters
$force : bool = false

force re-sort all children

Return values
$this

stripTags()

Wrapper for standard strip_tags() function with extra functionality for html entities

public stripTags(string $data[, string $allowableTags = null ][, bool $allowHtmlEntities = false ]) : string
Parameters
$data : string
$allowableTags : string = null
$allowHtmlEntities : bool = false
Return values
string

toArray()

Public wrapper for __toArray

public toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
$arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>

toHtml()

Produce and return block's html output

public final toHtml() : string

It is a final method, but you can override _toHtml() method in descendants if needed.

Return values
string

toJson()

Public wrapper for __toJson

public toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []
Return values
string

toString()

Public wrapper for __toString

public toString([string $format = '' ]) : string

Will use $format as an template and substitute {{key}} for attributes

Parameters
$format : string = ''
Return values
string

toXml()

Public wrapper for __toXml

public toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []
$rootName : string = 'item'
$addOpenTag : bool = false
$addCdata : bool = true
Return values
string

unsetCallChild()

Call a child and unset it, if callback matched result

public unsetCallChild(string $alias, string $callback, mixed $result, array<string|int, mixed> $params) : $this

$params will pass to child callback $params may be array, if called from layout with elements with same name, for example: ...value_1value_2value_3

Or, if called like this: ...value_1value_2value_3

  • then it will be $params1, $params2, $params3

It is no difference anyway, because they will be transformed in appropriate way.

Parameters
$alias : string
$callback : string
$result : mixed
$params : array<string|int, mixed>
Return values
$this

unsetChild()

Unset child block

public unsetChild(string $alias) : $this
Parameters
$alias : string
Return values
$this

unsetChildren()

Unset all children blocks

public unsetChildren() : $this
Return values
$this

unsetData()

Unset data from the object.

public unsetData([string $key = null ]) : $this

$key can be a string only. Array will be ignored.

Parameters
$key : string = null
Return values
$this

unsetOldData()

Unset old fields data from the object.

public unsetOldData([string $key = null ]) : $this

$key can be a string only. Array will be ignored.

Parameters
$key : string = null
Return values
$this

__toJson()

Convert object attributes to JSON

protected __toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []

array of required attributes

Return values
string

__toXml()

Convert object attributes to XML

protected __toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
$arrAttributes : array<string|int, mixed> = []

array of required attributes

$rootName : string = 'item'

name of the root element

$addOpenTag : bool = false
$addCdata : bool = true
Return values
string

_addConfiguredFonts()

The configured web font belongs to the storefront; the admin keeps its own.

protected _addConfiguredFonts() : void
Attributes
#[Override]

_addFullNames()

protected _addFullNames() : mixed

_addThemeFonts()

Add the web fonts the active skin identity declares in its etc/theme.xml.

protected _addThemeFonts() : void

Keyed on the skin theme: an identity is skin-only, so a layout file inside it would never load, because layout resolution reads getTheme('layout') instead.

A link element, not an @import inside theme.css: the preload scanner cannot see a URL inside a stylesheet, so an @import waits for theme.css to download and parse before the font request even starts.

_afterToHtml()

Processing block html after rendering

protected _afterToHtml(string $html) : string
Parameters
$html : string
Return values
string

_beforeToHtml()

Before rendering html, but after trying to load cache

protected _beforeToHtml() : $this
Return values
$this

_camelize()

protected _camelize(string $name) : string
Parameters
$name : string
Return values
string

_construct()

Initialize template

protected _construct() : void
Attributes
#[Override]

_getChildHtml()

Retrieve child block HTML

protected _getChildHtml(string $name[, bool $useCache = true ]) : string
Parameters
$name : string
$useCache : bool = true
Return values
string

_getData()

Get value from _data array without parse key

protected _getData(string $key) : mixed
Parameters
$key : string

_getFormKeyPlaceholder()

Get form key placeholder for cache

protected _getFormKeyPlaceholder([string|null $cacheKey = null ]) : string
Parameters
$cacheKey : string|null = null
Return values
string

_getTagsCacheKey()

Get cache key for tags

protected _getTagsCacheKey([string $cacheKey = null ]) : string
Parameters
$cacheKey : string = null
Return values
string

_getUrlModelClass()

Returns url model class name

protected _getUrlModelClass() : string
Attributes
#[Override]
Return values
string

_initOldFieldsMap()

Inits mapping array of object's previously used fields to new fields.

protected _initOldFieldsMap() : mixed

Must be overloaded by descendants to set concrete fields map.

_isFile()

If DB file storage is on - find there, otherwise - just file_exists

protected _isFile(string $filename) : bool
Parameters
$filename : string
Return values
bool

_isSecure()

Checks is request Url is secure

protected _isSecure() : bool
Return values
bool

_loadCache()

Load block html from cache storage

protected _loadCache() : string|false
Return values
string|false

_prepareArray()

Set required array elements

protected _prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
$arr : array<string|int, mixed>
$elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>

_prepareLayout()

Preparing global layout

protected _prepareLayout() : $this

You can redefine this method in child classes for changing layout

Return values
$this

_prepareOtherHtmlHeadElements()

Render arbitrary HTML head items

protected _prepareOtherHtmlHeadElements(array<string|int, mixed> $items) : string
Parameters
$items : array<string|int, mixed>
Tags
see
self::getCssJsHtml()
Return values
string

_prepareStaticAndSkinElements()

Merge static and skin files of the same format into 1 set of HEAD directives or even into 1 directive

protected & _prepareStaticAndSkinElements(string $format, array<string|int, mixed> $staticItems, array<string|int, mixed> $skinItems) : string

Will attempt to merge into 1 directive, if merging callback is provided. In this case it will generate filenames, rather than render urls. The merger callback is responsible for checking whether files exist, merging them and giving result URL

Parameters
$format : string
  • HTML element format for sprintf('<element src="%s"%s>', $src, $params)
$staticItems : array<string|int, mixed>
  • array of relative names of static items to be grabbed from js/ folder
$skinItems : array<string|int, mixed>
  • array of relative names of skin items to be found in skins according to design config
Return values
string

_prepareSyncFieldsMap()

Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.

protected _prepareSyncFieldsMap() : $this
Return values
$this

_saveCache()

Save block content to cache storage

protected _saveCache(string $data) : $this|false
Parameters
$data : string
Return values
$this|false

_separateOtherHtmlHeadElements()

Classify HTML head item and queue it into "lines" array

protected _separateOtherHtmlHeadElements(array<string|int, mixed> &$lines, string $itemType, string $itemParams, string $itemName, array<string|int, mixed> $itemThe) : mixed
Parameters
$lines : array<string|int, mixed>
$itemType : string
$itemParams : string
$itemName : string
$itemThe : array<string|int, mixed>
Tags
see
self::getCssJsHtml()

_sortItems()

protected _sortItems(string $referenceName, string|bool $before, string $type) : mixed
Parameters
$referenceName : string
$before : string|bool
$type : string

_toHtml()

Render block HTML

protected _toHtml() : string
Attributes
#[Override]
Return values
string

_underscore()

Converts field names for setters and getters

protected _underscore(string $name) : string

$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace

Parameters
$name : string
Return values
string
On this page

Search results