I am creating a custom module with a new URL. As of right now. If I put a echo into my Indexcontroller class and goto mydomain.com/index.php/advancedcatalog, It detects the echo But it does not detect my view. Here is my structure
/Advancedcatalog/Block/Advancedcatalog.php
Advancedcatalog.php
<?php
class Webwow_Advancedcatalog_Block_Advancedcatalog extends Mage_Core_Block_Template
{
public function _prepareLayout()
{
return parent::_prepareLayout();
}
public function getHelloworld()
{
return 'Hello world';
}
}
/Advancedcatalog/controllers/IndexController.php
IndexController.php
<?php
class Webwow_Advancedcatalog_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
/Advancedcatalog/Model/Advancedcatalog.php
Advancedcatalog.php
<?php
class Webwow_Advancedcatalog_Model_Advancedcatalog extends Mage_Core_Model_Abstract
{
public function _construct()
{
parent::_construct();
$this->_init('advancedcatalog/advancedcatalog');
}
}
/Advancedcatalog/etc/config.xml
<?xml version="1.0" ?>
<config>
<modules>
<Webwow_Advancedcatalog>
<version>0.1.0</version>
</Webwow_Advancedcatalog>
</modules>
<frontend>
<routers>
<advancedcatalog>
<use>standard</use>
<args>
<module>Webwow_Advancedcatalog</module>
<frontName>advancedcatalog</frontName>
</args>
</advancedcatalog>
</routers>
<layout>
<updates>
<advancedcatalog>
<file>advancedcatalog.xml</file>
</advancedcatalog>
</updates>
</layout>
</frontend>
<global>
<blocks>
<advancedcatalog>
<class>Webwow_Advancedcatalog_Block</class>
</advancedcatalog>
</blocks>
</global>
</config>
Here is my layout
/layout/advancedcatalog.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<advancedcatalog_index_index>
<reference name="content">
<block type="advancedcatalog/advancedcatalog" name="advancedcatalog"
template="advancedcatalog/helloworld.phtml" />
</reference>
</advancedcatalog_index_index>
</layout>
/templates/advancedcatalog/helloworld.phtml
<h2><?php echo $this->getHelloworld(); ?></h2>
TESTING