Sohail
Sohail

Reputation: 2332

Magento block type

In magento blocks what does block type means as in the below block?

<block type="core/template" template="example/view.phtml" />

Please help me in learning magento module development.

Is there some good resource?

Upvotes: 4

Views: 5641

Answers (2)

Fadzly Othman
Fadzly Othman

Reputation: 1702

Here's what I learnt -

type refers to the PHP file that will provide the methods for this phtml. Examaple:

/app/code/local/modstorm/Block/Filename.php , where all your methods for this block resides. So if, for example, you are have something like $this->getMethodName() in your .phtml, you must have getMethodName() function declared in /app/code/local/modstorm/block/Filename.php.

Hope this helps others as well.

Upvotes: 0

Alana Storm
Alana Storm

Reputation: 166076

The block "type" is a PHP Class. In a normal system, a

core/template

block type will become a Mage_Core_Block_Template class.

As for resources, start here (self link)

Upvotes: 7

Related Questions