Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
Last active January 1, 2016 06:39
Show Gist options
  • Save xcommerce-gists/8106110 to your computer and use it in GitHub Desktop.
Save xcommerce-gists/8106110 to your computer and use it in GitHub Desktop.
Magento simple Hello World extension: Template helpers
/**
* Magento simple Hello World extension: Template helpers
*
* Helper classes for the template
* provided for documentation purposes in the
* Magento 1.x Extension Developer's Guide
*
* @copyright Copyright (c) 2014 eBay Inc. (http://www.magentocommerce.com)
*/
<?php
class Tutorials_Hello_Block_Hello extends Mage_Core_Block_Template {
public function _prepareLayout()
{
$this->getLayout()->getBlock('breadcrumbs')
->addCrumb('home',
array('label'=>Mage::helper('catalogsearch')->__('Home'),
'title'=>Mage::helper('catalogsearch')->__('Go to Home Page'),
'link'=>Mage::getBaseUrl())
)
->addCrumb('customer',
array('label'=>Mage::helper('customer')->__('Hello'))
);
return parent::_prepareLayout();
}
public function getHello()
{
echo $this->__('Hello World');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment