Created
September 12, 2013 13:00
-
-
Save philwinkle/6536888 to your computer and use it in GitHub Desktop.
Avoiding helpers cross-module. http://www.reddit.com/r/Magento/comments/1m6rx7/global_helpers_via_php_closures_and_mageregistry/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('app/Mage.php'); | |
Mage::app(); | |
$model = Mage::getModel('catalog/fakeproduct'); | |
var_dump($model); | |
//=>bool(false) | |
$helper = Mage::helper('fakemodule'); | |
//=>PHP Fatal error: Class 'Mage_Fakemodule_Helper_Data' not found in /app/Mage.php on line 546 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment