$data = new Varien_Object(array('title' => 'My Title')); echo $data->getHtml();
class Custom_Object extends Varien_Object { public function toHtml() { return "This example creates a subclass of Varien_Object called Custom_Object. It overrides the toHtml() method to customize how the object is displayed as HTML. It then creates an instance of this subclass and passes an array with a 'title' key to it. The toHtml() method on that instance is then called, which will output a HTML div containing the title value. Package library: Magento.{$this->getTitle()}"; } } $data = new Custom_Object(array('title' => 'My Title')); echo $data->toHtml();