I am creating module in magento 1.9.1, to create a attribute for categories. I have created files as follows:
app\etc\modules\Ddevs_Ebayaff.xml
<?xml version="1.0"?>
<config>
<modules>
<Ddevs_Ebayaff>
<active>true</active>
<codePool>local</codePool>
</Ddevs_Ebayaff>
</modules>
</config>
I am trying to call controller and mysql install script in one config file as follows
app\code\local\Ddevs\Ebayaff\etc\config.xml
<?xml version="1.0"?> <config>
<modules>
<ddevs_ebayaff>
<version>
0.1.0
</version>
</ddevs_ebayaff>
</modules>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>Ddevs_Ebayaff</module>
<frontName>ebayaffload</frontName>
</args>
</helloworld>
</routers>
</frontend>
<global>
<resources>
<add_category_attribute>
<setup>
<module>Ddevs_Ebayaff</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
</add_category_attribute>
</resources>
</global>
</config>
In IndexController, i have the following content
app\code\local\Ddevs\Ebayaff\controllers\IndexController.php
<?php
class Ddevs_Ebayaff_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
$this->loadLayout();
$this->renderLayout();
}
}
And my install script as follows:
app\code\local\Ddevs\Ebayaff\sql\add_category_attribute\mysql4-install-0.1.0.php
<?php
$this->startSetup();
$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'ddev_ebayaff_cat', array(
'group' => 'General Information',
'input' => 'text',
'type' => 'text',
'label' => 'Category ID',
'backend' => '',
'visible' => true,
'required' => false,
'visible_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$this->endSetup();