Public Member Functions | |
__construct () | |
addHandler ($method, $handler) | |
getHandlers ($method) | |
process ($method, $result, $params) | |
productAttribute ($product, $attributeHtml, $attributeName) | |
categoryAttribute ($category, $attributeHtml, $attributeName) | |
Protected Attributes | |
$_handlers |
Definition at line 27 of file Output.php.
__construct | ( | ) |
Definition at line 36 of file Output.php.
00037 { 00038 Mage::dispatchEvent('catalog_helper_output_construct', array('helper'=>$this)); 00039 }
addHandler | ( | $ | method, | |
$ | handler | |||
) |
Adding method handler
string | $method | |
object | $handler |
Definition at line 48 of file Output.php.
00049 { 00050 if (!is_object($handler)) { 00051 return $this; 00052 } 00053 $method = strtolower($method); 00054 00055 if (!isset($this->_handlers[$method])) { 00056 $this->_handlers[$method] = array(); 00057 } 00058 00059 $this->_handlers[$method][] = $handler; 00060 return $this; 00061 }
categoryAttribute | ( | $ | category, | |
$ | attributeHtml, | |||
$ | attributeName | |||
) |
Prepare category attribute html output
Mage_Catalog_Model_Category | $category | |
string | $attributeHtml | |
string | $attributeName |
Definition at line 118 of file Output.php.
00119 { 00120 $attributeHtml = $this->process('categoryAttribute', $attributeHtml, array( 00121 'category' => $category, 00122 'attribute' => $attributeName 00123 )); 00124 return $attributeHtml; 00125 }
getHandlers | ( | $ | method | ) |
Get all handlers for some method
string | $method |
Definition at line 69 of file Output.php.
00070 { 00071 $method = strtolower($method); 00072 return isset($this->_handlers[$method]) ? $this->_handlers[$method] : array(); 00073 }
process | ( | $ | method, | |
$ | result, | |||
$ | params | |||
) |
Process all method handlers
string | $method | |
mixed | $result | |
array | $params |
Definition at line 83 of file Output.php.
00084 { 00085 foreach ($this->getHandlers($method) as $handler) { 00086 if (method_exists($handler, $method)) { 00087 $result = $handler->$method($this, $result, $params); 00088 } 00089 } 00090 return $result; 00091 }
productAttribute | ( | $ | product, | |
$ | attributeHtml, | |||
$ | attributeName | |||
) |
Prepare product attribute html output
Mage_Catalog_Model_Product | $product | |
string | $attributeHtml | |
string | $attributeName |
Definition at line 101 of file Output.php.
00102 { 00103 $attributeHtml = $this->process('productAttribute', $attributeHtml, array( 00104 'product' => $product, 00105 'attribute' => $attributeName 00106 )); 00107 return $attributeHtml; 00108 }
$_handlers [protected] |
Definition at line 34 of file Output.php.