I'm faced with a problem where I can either make a helper in my extension to do some simple task or override multiple block class functions. This is a utility function, so I would typically make a helper, but it is going to be used in templates to manipulate outputs to the screen. For simplicity's sake, let's say I just want to replace the string ABC
with XYZ
in some cases, and it cannot be done via translation.
Here's the dilemma, since template files are not contained in the app
directory, you could potentially get fatal errors when you disable the relevant extension and leave rogue helper calls in the templates. There are multiple template files where I would need to utilize this function. I've seen rogue helper calls break pages on multiple sites.
While I can also customize each of the templates to minimize potential errors, a simple Mage::helper('myextension')->convertString($str)
would reduce the amount of work significantly.
What's your take on this kind of issue? I know it's subjective, but I did not find any useful reference online, and I just have my own judgement call. It doesn't hurt to hear what others have to say!
Not completely relevant but still here's one discussion.