Below are the steps to create module to print "Hello Aftab !"
Step 1. Create: app/etc/modules/Aftab_Hello.xml put:
Step 1. Create: app/etc/modules/Aftab_Hello.xml put:
<xml version="1.0"?>Step2. Create: app/code/local/Aftab/Helloaftab/config.xml Put:true local
<?xml version="1.0"?>Step3. Create: app/code/local/Aftab/Helloaftab/controllers/IndexController.php Put:0.1.0 Aftab_Helloaftab helloaftab helloaftab.xml Aftab_Helloaftab_Block
class Aftab_Helloaftab_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
//echo "Hello Aftab !";
$this->loadLayout();
$this->renderLayout();
}
public function arshadAction()
{
//echo "Hello Arshad !";
$this->loadLayout();
$this->renderLayout();
}
}
Step 4.
Create: app/code/local/Aftab/Helloaftab/Block/helloaftab.php
Put:
class Aftab_Helloaftab_Block_Helloaftab extends Mage_Core_Block_Template
{
}
Step 5.
Create: app/design/frontend/YOUR_THEME_PACKAGE/YOUR_THEME/layout/helloaftab.xml
Put:
Step 6. Create: app/design/frontend/YOUR_THEME_PACKAGE/YOUR_THEME/template/helloaftab/helloaftab.phtml Put:
echo "Hello Aftab !";Step 7. http://you-site-url/helloaftab/index/ Or http://you-site-url/helloaftab/index/index
No comments:
Post a Comment