Reputation: 358
How can we use the helper from another app's module in Symfony1.4?
I want to reuse the same helper class without duplicating content.
Upvotes: 0
Views: 97
Reputation: 151
The easiest and recommended way would be moving this helper out of the apps, to the project lib/helper directory.
You can also use the fact that $moduleName parameter is not really validated nor escaped in sfApplicationConfiguration::getHelperDirs(), however moving it looks much cleaner than this dirty workaround:
sfContext::getInstance()->getConfiguration()->loadHelpers(['Test'], '../../other_app/modules/other_module');
Upvotes: 8