I have created custom module and I need to add button in header.phtml which 'onclick' will call a method from my module but i'm not sure how to do this. Should I create block and template or any other way? Can you give me some tips because "View" part is still a mystery for me.
1 Answer
Furoris:Create block class and template file and layout file call this template and make header as reference block.Then on header.phtml call this block using getChildHtml();
just Like:
<default><!- call on all pages -->
<reference name="header">
<block type="yourBLockPrefix/restofblockclass" name="myblockcustom" template="mytem patefoder/mytemplate.phtml"/>
</reference>
</default>
header.phtml:
add the code <php echo $this->getChildHtml('myblockcustom')?>