Mage_Catalog_Helper_Output Class Reference

Inheritance diagram for Mage_Catalog_Helper_Output:

Mage_Core_Helper_Abstract

List of all members.

Public Member Functions

 __construct ()
 addHandler ($method, $handler)
 getHandlers ($method)
 process ($method, $result, $params)
 productAttribute ($product, $attributeHtml, $attributeName)
 categoryAttribute ($category, $attributeHtml, $attributeName)

Protected Attributes

 $_handlers


Detailed Description

Definition at line 27 of file Output.php.


Constructor & Destructor Documentation

__construct (  ) 

Definition at line 36 of file Output.php.

00037     {
00038         Mage::dispatchEvent('catalog_helper_output_construct', array('helper'=>$this));
00039     }


Member Function Documentation

addHandler ( method,
handler 
)

Adding method handler

Parameters:
string $method
object $handler
Returns:
Mage_Catalog_Helper_Output

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

Parameters:
Mage_Catalog_Model_Category $category
string $attributeHtml
string $attributeName
Returns:
string

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

Parameters:
string $method
Returns:
array

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

Parameters:
string $method
mixed $result
array $params
Returns:
unknown

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

Parameters:
Mage_Catalog_Model_Product $product
string $attributeHtml
string $attributeName
Returns:
string

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     }


Member Data Documentation

$_handlers [protected]

Definition at line 34 of file Output.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:37 2009 for Magento by  doxygen 1.5.8