omeka / Omeka

A flexible web publishing platform for the display of library, museum and scholarly collections, archives and exhibitions.
http://omeka.org
GNU General Public License v3.0
481 stars 195 forks source link

Always load helpers #259

Closed zerocrates closed 11 years ago

zerocrates commented 12 years ago

The distinction between what is a global function and what is a theme helper is nebulous at best.

Whatever value there is in making it harder for developers to misuse helpers in controllers and models is offset, I think, by the annoyance of developers with legitimate needs to use particular helper functions and the outward unpredictability of which functions will cause a fatal error and where.

We draw a quasi-distinction between the helpers and "global" functions, but all the helpers are, in fact, global functions, it's just that their loading is somewhat delayed.

patrickmj commented 12 years ago

In some ways it's counter-intuitive, but ultimately I think it makes sense that to get started more rigidly enforced structure makes it easier to get going.

If we can (re?)draw a sharp distinction between theme helpers and globals (maybe even remove globals?), I think that would help target our documentation, our responses on the forums, and generally maintain sanity

I lean toward the idea that the job of theme helpers is to conceal the background OO work and syntax.

Pretty, yes, but nebulas bad.

jimsafley commented 11 years ago

Proposed solution:

Move all theme functions to application/libraries/globals.php and delete application/helpers/. Remove all references to HELPERS constant (defined in paths.php).