Helper Overrides

Permalink
Hi,
I need to override the avatar helper (amongst others) in 5.4.0.5 and can not.

I know this has been discussed a few times, but I wondered a solution was ever arrived at?

I'm searching and not turning up a lot...

Thanks.

moth
 
olsgreen replied on at Permalink Reply
olsgreen
Hi,

No, not as far as I'm aware. I've tried exactly the same thing today and I just get duplicate definition errors, which means you can't 'override' them.

The easiest way is to create a new helper class that extends the helper you would like to overide and make the changes to the methods you need to within that.

Oli
moth replied on at Permalink Reply
moth
That's a shame. Would I need to rename those methods? I guess you still can't override one..
olsgreen replied on at Permalink Reply
olsgreen
Yes,

For instance, I needed to override the mail helper so I copied the C5 mail helper from /concrete/helpers/mail.php to /helpers/custom-mail.php, renamed the class and then made my alterations.

O
russellfeeed replied on at Permalink Reply
russellfeeed