For all intents and purposes, this should be working.. But it's not.
Structure:
app / etc / modules / Company_Modulename.xml
<?xml version="1.0"?> <config> <modules> <Company_Modulename> <active>true</active> <codePool>community</codePool> <version>1.0.0</version> </Company_Modulename> </modules> </config>
app / code / community / Company / Modulename / etc / config.xml
<?xml version="1.0"?> <config> <modules> <Company_Modulename> <version>1.0.0</version> </Company_Modulename> </modules> <global> <helpers> <modulename> <class>Company_Modulename_Helper</class> </modulename> </helpers> </global> </config>
- app / code / community / Company / Modulename / Helper / Data.php
<?php class Company_Modulename_Helper_Data extends Mage_Core_Helper_Abstract { public function sayHello() { die('hello'); } }
- app / design / frontend / custom / default / template / page / 2columns-right.phtml
... <?php Mage::helper('modulename')->sayHello(); ?> ...
This should be die'ing with the word 'hello'. Instead, I'm getting:
Warning: include(Mage/Modulename/Helper/Data.php): failed to open stream: No such file or directory in /var/www/html/testing/lib/Varien/Autoload.php on line 94
I've set all module files' permissions to 777 just in case. Any ideas?
Edit: I have tried renaming Data.php to Helper.php (also modified class name), and tried to invoke it with Mage::helper('modulename/helper')->... , as expected - it threw the same error, changed the file name it was looking for to Helper.php but kept using the same path.
Compilation is off, cache is disabled (clearing it before each test anyway)