Include Paths & Helper Files

Permalink 2 users found helpful
A close look at the helper() method in loader.php seems to indicate that helper files (or more specifically, the classes defined within them) don't follow the "usual" override rules. To override a core helper, it appears you create the appropriate file in the corresponding site directory as usual, but that you MUST extend the class be adding the prefix "Site" to the core's class name. So for example, to override...

/concrete/helpers/concrete/urls.php would create a new file at...


...and then define the following class within that file...

class SiteConcreteUrlsHelper extends ConcreteUrlsHelper {
   // Implement class here

In other words, simply duplicating the core helper file to the corresponding site directory won't work like it does on other core files.


View Replies:
andrew replied on at Permalink Reply
Yeah, due to the way they've matured, helpers are a little more specialized than most models and libraries. Site helpers will require "Site" in front of their class, and should usually extend their base helper.

In many cases this would be useful for models, libraries as well, but it hasn't matured that way.
moth replied on at Permalink Reply
You have no idea how much I wish you'd have told us this sooner... ;)