Quantcast
Channel: Webkul Blog
Viewing all articles
Browse latest Browse all 5488

Start Magento2 “Hello Word” Module

$
0
0

Note:- “Webkul” is your company name and Test is module name

Folder structure

Untitled

for hello word module

files are following

app/code/Webkul/Test/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Webkul_Test> <!--Module discription-->
            <version>1.0.0</version>
            <active>true</active>
        </Webkul_Test>
    </modules>	
    <frontend>
     <layout>
            <updates>
                <webkul_test module="Webkul_Test">
                    <file>layout.xml</file>
                </webkul_test>
            </updates>
        </layout>
    </frontend>
</config>

app/code/Webkul/Test/Block/Hello.php

<?php
class Webkul_Test_Block_Hello extends Mage_Core_Block_Template{

}

?>

app/design/frontend/default/demo/Webkul_Test/layout.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalog_product_view>
	<reference name="content">
		<block type="Webkul_Test_Block_Hello" name="wk-block" template="hello.phtml" />
	</reference >
    </catalog_product_view>	
</layout>

app/design/frontend/default/demo/Webkul_Test/Hello.phtml

<?php ?>
<h2>hello new magento</h2>
Facebook Twitter Email Reddit Stumbleupon

Viewing all articles
Browse latest Browse all 5488

Trending Articles