sqlmole
sqlmole

Reputation: 997

Helper classes in Codeigniter - are they really bad and why?

I am developing my system with helper classes and I see on several sources that say "Helper classes" are not recommended in object orientated programming.

If so, why are they considered bad?

How do they play in with the MVC framework of Codeigniter?

Thanks

Upvotes: 2

Views: 800

Answers (1)

Matt Stein
Matt Stein

Reputation: 3053

The strength and weakness of the helpers is that they don't neatly fit into the MVC framework; they're more like glue than wood or steel framing. They can be convenient to use in several contexts and are well-suited for common, light tasks. If your helpers become more complex and start needing to interact with models and controllers, odds are you've got a questionable design that needs to be more carefully considered. Glue and duct tape may be useful, but you'll be hard-pressed to find a skyscraper made of them.

Upvotes: 4

Related Questions