Published by Mijingo

movie icon image

EE Insider Blog

Spend your time learning and developing sites with ExpressionEngine and we'll use this blog to keep you informed of all the news related to ExpressionEngine and CodeIgniter.

» Read more in the Archives.

» Have a tip? Send us your EE news.

Learn ExpressionEngine Today

Over a series of 8 videos, watch and learn as Ryan builds an entire ExpressionEngine website from beginning to end. Get started now.

Good Advice: Hook Don’t Hack

The gentlepeople at Made By Hippo shared how they approach extending add-ons that don’t do exactly what they need:

[W]e have started adding custom hooks into existing addons and points in the code that we need to inject our functionality. Not only does this abstract the custom logic away from the core add-on, but it means you’re looking at 2-3 lines of code when it comes to upgrading the add-on for future releases.

Rather than hacking at the code, they just give themselves a place to inject their own code. Still a hack but cleaner because it’s easier to update.

Great write-up. Read the entire article for all the information, including code samples to get you started.

Posted on Aug 31, 2012 by Ryan Irelan

Filed Under: Development Tools, EE Add-ons

Brian09:55 on 08.31.2012

Be sure to send these sorts of changes to the add-on developer explaining why you needed the hook. If its a good or common use case, then hopefully it will get added to the official release, then you don’t have to hack anymore if you upgrade.