Class Mage_Core_Block_Abstract

Description

Base Content Block class

For block generation you must define Data source class, data source class method, parameters array and block template

Located in /Core/Block/Abstract.php (line 38)

Varien_Object
   |
   --Mage_Core_Block_Abstract
Direct descendents
Class Description
Mage_Paypal_Block_Standard_Redirect Magento
Mage_Adminhtml_Block_Urlrewrite_Link Label & link block
Mage_Cms_Block_Block Cms block content block
Mage_Cms_Block_Page Cms page content block
Mage_CatalogSearch_Block_Autocomplete Autocomplete queries list
Mage_Catalog_Block_Product_Price_Template Catalog Product Price Template Block
Mage_Customer_Block_Address_Renderer_Default Address format renderer default
Mage_Rule_Block_Editable Magento
Mage_Rule_Block_Newchild Magento
Mage_Rule_Block_Rule Magento
Mage_Page_Block_Html_Wrapper A generic wrapper block that renders its children and supports a few parameters of the wrapper HTML-element
Mage_Core_Block_Profiler Magento
Mage_Core_Block_Flush Immediate flush block. To be used only as root
Mage_Core_Block_Text Base html block
Mage_Core_Block_Template Base html block
Mage_Core_Block_Html_Select HTML select element block
Class Constant Summary
CACHE_GROUP = 'block_html'
Variable Summary
Method Summary
void addToChildGroup (string $groupName, Mage_Core_Block_Abstract $child)
Mage_Core_Block_Abstract append (Mage_Core_Block_Abstract|string $block, [string $alias = ''])
int countChildren ()
string escapeHtml (mixed $data, [array $allowedTags = null])
string escapeUrl (string $data)
string formatDate ([string $date = null], [string $format = 'short'], [bool $showTime = false])
string formatTime ([string $time = null], [string $format = 'short'], [bool $showDate = false])
void getAnonSuffix ()
void getBlockAlias ()
string getBlockHtml (string $name)
string getCacheKey ()
array getCacheKeyInfo ()
array getCacheTags ()
mixed getChild ([string $name = ''])
void getChildChildHtml ( $name, [ $childName = ''], [ $useCache = true], [ $sorted = false])
mixed getChildData (string $alias, [string $key = ''])
array getChildGroup (string $groupName, [string $callback = null], [bool $skipEmptyResults = true])
string getChildHtml ([string $name = ''], [boolean $useCache = true], [ $sorted = false])
bool getIsAnonymous ()
string getModuleName ()
string getNameInLayout ()
string getSkinUrl ([string $file = null], [ $params = array()])
string getUrl ([string $route = ''], [array $params = array()])
string getUrlBase64 ([string $route = ''], [array $params = array()])
string getUrlEncoded ([string $route = ''], [array $params = array()])
void htmlEscape ( $data, [ $allowedTags = null])
object insert (Mage_Core_Block_Abstract|string $block, [string $siblingName = ''], [boolean $after = false], [string $alias = ''])
mixed jsQuoteEscape (mixed $data, [string $quote = '\''])
void setAnonSuffix ( $suffix)
Mage_Core_Block_Abstract setAttribute (string $name, [mixed $value = null])
void setBlockAlias ( $alias)
Mage_Core_Block_Abstract setChild ( $alias, Mage_Core_Block_Abstract $block, string $name)
Mage_Core_Block_Abstract setFrameTags ($openTag $openTag, [$closeTag $closeTag = null])
void setIsAnonymous ( $flag)
string stripTags (string $data, [string $allowableTags = null], [bool $allowHtmlEntities = false])
string toHtml ()
Mage_Core_Block_Abstract unsetCallChild (string $alias, string $callback, mixed $result, array $params)
Mage_Core_Block_Abstract unsetChild ( $alias, string $name)
void urlEscape ( $data)
string _afterCacheUrl (string $html)
string _afterToHtml (string $html)
void _beforeChildToHtml (string $name, Mage_Core_Block_Abstract $child)
void _construct ()
string _getChildHtml (string $name, [boolean $useCache = true])
string _getUrlModelClass ()
string _loadCache ()
string _toHtml ()
string __ ()
Variables
static mixed $_urlModel (line 144)
  • access: protected
string $_alias (line 67)

Short alias of this block to be refered from parent

  • access: protected
string $_anonSuffix (line 74)

Suffix for name of anonymous block

  • access: protected
array $_childGroups = array() (line 102)

Arbitrary groups of child blocks

  • access: protected
array $_children = array() (line 81)

Contains references to child block objects

  • access: protected
array $_childrenHtmlCache = array() (line 95)

Children blocks HTML cache array

  • access: protected
string $_frameCloseTag (line 142)

Block html frame close tag

  • access: protected
string $_frameOpenTag (line 136)

Block html frame open tag

  • access: protected
boolean $_isAnonymous = false (line 123)

Whether this block was not explicitly named

  • access: protected
Mage_Core_Model_Layout $_layout (line 53)

Parent layout of the block

  • access: protected
Mage_Core_Block_Messages $_messagesBlock = null (line 116)

Messages block instance

  • access: protected
string $_nameInLayout (line 46)

Block name in layout

  • access: protected
Mage_Core_Block_Abstract $_parent (line 60)

Parent block

  • access: protected
Mage_Core_Block_Abstract $_parentBlock (line 130)

Parent block

  • access: protected
Zend_Controller_Request_Http $_request (line 109)

Request object

  • access: protected
array $_sortedChildren = array() (line 88)

Sorted children list

  • access: protected
Methods
addToChildGroup (line 636)

Make sure specified block will be registered in the specified child groups

  • access: public
void addToChildGroup (string $groupName, Mage_Core_Block_Abstract $child)
addToParentGroup (line 652)

Add self to the specified group of parent block

  • access: public
Mage_Core_Block_Abstract addToParentGroup (string $groupName)
  • string $groupName
append (line 624)

Append child block

  • access: public
Mage_Core_Block_Abstract append (Mage_Core_Block_Abstract|string $block, [string $alias = ''])
countChildren (line 1062)

Get chilren blocks count

  • access: public
int countChildren ()
escapeHtml (line 998)

Escape html entities

  • access: public
string escapeHtml (mixed $data, [array $allowedTags = null])
  • mixed $data
  • array $allowedTags
escapeUrl (line 1031)

Escape html entities in url

  • access: public
string escapeUrl (string $data)
  • string $data
formatDate (line 935)

Retrieve formating date

  • access: public
string formatDate ([string $date = null], [string $format = 'short'], [bool $showTime = false])
  • string $date
  • string $format
  • bool $showTime
formatTime (line 948)

Retrieve formating time

  • access: public
string formatTime ([string $time = null], [string $format = 'short'], [bool $showDate = false])
  • string $time
  • string $format
  • bool $showDate
getAction (line 208)

Retrieve current action object

  • access: public

Redefined in descendants as:
getAnonSuffix (line 265)
  • access: public
void getAnonSuffix ()
getBlockAlias (line 276)
  • access: public
void getBlockAlias ()
getBlockHtml (line 548)

Retrieve block html

  • access: public
string getBlockHtml (string $name)
  • string $name
getCacheKey (line 1115)

Get Key for caching block content

  • access: public
string getCacheKey ()
getCacheKeyInfo (line 1103)

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

  • access: public
array getCacheKeyInfo ()

Redefined in descendants as:
getCacheLifetime (line 1153)

Get block cache life time

  • access: public
int getCacheLifetime ()

Redefined in descendants as:
getCacheTags (line 1137)

Get tags array for saving cache

  • access: public
array getCacheTags ()
getChild (line 442)

Retrieve child block by name

  • access: public
mixed getChild ([string $name = ''])
  • string $name
getChildChildHtml (line 480)
  • access: public
void getChildChildHtml ( $name, [ $childName = ''], [ $useCache = true], [ $sorted = false])
  • $name
  • $childName
  • $useCache
  • $sorted
getChildData (line 700)

Get a value from child block by specified key

  • access: public
mixed getChildData (string $alias, [string $key = ''])
  • string $alias
  • string $key
getChildGroup (line 670)

Get a group of child blocks

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

  • access: public
array getChildGroup (string $groupName, [string $callback = null], [bool $skipEmptyResults = true])
  • string $groupName
  • string $callback
  • bool $skipEmptyResults
getChildHtml (line 459)

Retrieve child block HTML

  • access: public
string getChildHtml ([string $name = ''], [boolean $useCache = true], [ $sorted = false])
  • string $name
  • boolean $useCache
  • $sorted

Redefined in descendants as:
getHelper (line 907)

Enter description here...

  • access: public
Mage_Core_Block_Abstract getHelper (string $type)
  • string $type
getIsAnonymous (line 254)

Check if block is using auto generated (Anonymous) name

  • access: public
bool getIsAnonymous ()
getLayout (line 245)

Retrieve layout object

  • access: public
Mage_Core_Model_Layout getLayout ()
getMessagesBlock (line 881)

Retrieve messages block

  • access: public
Mage_Core_Block_Messages getMessagesBlock ()

Redefined in descendants as:
getModuleName (line 958)

Retrieve module name of block

  • access: public
string getModuleName ()
getNameInLayout (line 1053)

Alias for getName method.

  • access: public
string getNameInLayout ()
getParentBlock (line 186)

Retrieve parent block

  • access: public
Mage_Core_Block_Abstract getParentBlock ()
getRequest (line 170)

Retrieve request object

  • access: public
getSkinUrl (line 871)

Retrieve url of skins file

  • access: public
string getSkinUrl ([string $file = null], [ $params = array()])
  • string $file: path to file in skin
  • array $params
getSortedChildBlocks (line 497)

Obtain sorted child blocks

  • access: public
array getSortedChildBlocks ()
getSortedChildren (line 303)
  • access: public
void getSortedChildren ()
getUrl (line 835)

Generate url by route and parameters

  • access: public
string getUrl ([string $route = ''], [array $params = array()])
  • string $route
  • array $params

Redefined in descendants as:
getUrlBase64 (line 847)

Generate base64-encoded url by route and parameters

  • access: public
string getUrlBase64 ([string $route = ''], [array $params = array()])
  • string $route
  • array $params
getUrlEncoded (line 859)

Generate url-encoded url by route and parameters

  • access: public
string getUrlEncoded ([string $route = ''], [array $params = array()])
  • string $route
  • array $params
helper (line 919)

Enter description here...

  • access: public
Mage_Core_Block_Abstract helper (string $name)
  • string $name
htmlEscape (line 986)
  • see: self::escapeHtml()
  • deprecated: after 1.4.0.0-rc1
  • access: public
void htmlEscape ( $data, [ $allowedTags = null])
  • $data
  • $allowedTags
insert (line 568)

Insert child block

  • access: public
object insert (Mage_Core_Block_Abstract|string $block, [string $siblingName = ''], [boolean $after = false], [string $alias = ''])
jsQuoteEscape (line 1043)

Escape quotes in java scripts

  • access: public
mixed jsQuoteEscape (mixed $data, [string $quote = '\''])
  • mixed $data
  • string $quote
setAnonSuffix (line 270)
  • access: public
void setAnonSuffix ( $suffix)
  • $suffix
setAttribute (line 317)

Set block attribute value

Wrapper for method "setData"

  • access: public
Mage_Core_Block_Abstract setAttribute (string $name, [mixed $value = null])
  • string $name
  • mixed $value
setBlockAlias (line 281)
  • access: public
void setBlockAlias ( $alias)
  • $alias
setChild (line 329)

Set child block

  • access: public
Mage_Core_Block_Abstract setChild ( $alias, Mage_Core_Block_Abstract $block, string $name)
setFrameTags (line 725)

Specify block output frame tags

  • access: public
Mage_Core_Block_Abstract setFrameTags ($openTag $openTag, [$closeTag $closeTag = null])
  • $openTag $openTag
  • $closeTag $closeTag
setIsAnonymous (line 259)
  • access: public
void setIsAnonymous ( $flag)
  • $flag
setLayout (line 219)

Set layout object

  • access: public
setMessagesBlock (line 895)

Set messages block

  • access: public
setNameInLayout (line 293)

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

  • access: public
Mage_Core_Block_Abstract setNameInLayout ($name $name)
  • $name $name
setParentBlock (line 197)

Set parent block

  • access: public
stripTags (line 1011)

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

  • access: public
string stripTags (string $data, [string $allowableTags = null], [bool $allowHtmlEntities = false])
  • string $data
  • string $allowableTags
  • bool $allowHtmlEntities
toHtml (line 743)

Produce and return block's html output

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

  • access: public
string toHtml ()
unsetCallChild (line 405)

Call a child and unset it, if callback matched result

$params will pass to child callback $params may be array, if called from layout with elements with same name, for example: ...<foo>value_1</foo><foo>value_2</foo><foo>value_3</foo>

Or, if called like this: ...<foo>value_1</foo><bar>value_2</bar><baz>value_3</baz>

  • then it will be $params1, $params2, $params3
It is no difference anyway, because they will be transformed in appropriate way.

  • access: public
Mage_Core_Block_Abstract unsetCallChild (string $alias, string $callback, mixed $result, array $params)
  • string $alias
  • string $callback
  • mixed $result
  • array $params
unsetChild (line 370)

Unset child block

  • access: public
Mage_Core_Block_Abstract unsetChild ( $alias, string $name)
  • string $name
  • $alias
unsetChildren (line 429)

Unset all children blocks

  • access: public
Mage_Core_Block_Abstract unsetChildren ()
urlEscape (line 1020)
  • see: self::escapeUrl()
  • deprecated: after 1.4.0.0-rc1
  • access: public
void urlEscape ( $data)
  • $data
_afterCacheUrl (line 1086)

Replace URLs from cache

  • access: protected
string _afterCacheUrl (string $html)
  • string $html
_afterToHtml (line 793)

Processing block html after rendering

  • access: protected
string _afterToHtml (string $html)
  • string $html

Redefined in descendants as:
_beforeCacheUrl (line 1072)

Prepare url for save to cache

  • access: protected
Mage_Core_Block_Abstract _beforeCacheUrl ()
_beforeChildToHtml (line 538)

Prepare child block before generate html

  • access: protected
void _beforeChildToHtml (string $name, Mage_Core_Block_Abstract $child)
_beforeToHtml (line 713)

Before rendering html, but after trying to load cache

  • access: protected
Mage_Core_Block_Abstract _beforeToHtml ()

Redefined in descendants as:
_construct (line 158)

Internal constructor, that is called from real constructor

Please override this one instead of overriding real __construct constructor

  • access: protected
void _construct ()

Redefined in descendants as:
_getChildHtml (line 513)

Retrieve child block HTML

  • access: protected
string _getChildHtml (string $name, [boolean $useCache = true])
  • string $name
  • boolean $useCache
_getUrlModel (line 823)

Enter description here...

  • access: protected
Mage_Core_Model_Url _getUrlModel ()
_getUrlModelClass (line 813)

Enter description here...

  • access: protected
string _getUrlModelClass ()

Redefined in descendants as:
_loadCache (line 1166)

Load block html from cache storage

  • return: | false
  • access: protected
string _loadCache ()
_prepareLayout (line 235)

Preparing global layout

You can redefine this method in child classes for changin layout

  • access: protected
Mage_Core_Block_Abstract _prepareLayout ()

Redefined in descendants as:
_saveCache (line 1180)

Save block content to cache storage

  • access: protected
Mage_Core_Block_Abstract _saveCache (string $data)
  • string $data
_toHtml (line 803)

Override this method in descendants to produce html

  • access: protected
string _toHtml ()

Redefined in descendants as:
__ (line 974)

Translate block sentence

  • access: public
string __ ()
Class Constants
CACHE_GROUP = 'block_html' (line 40)

Documentation generated on Fri, 11 Feb 2011 16:55:33 +0200 by phpDocumentor 1.4.3