Closed sirfilip closed 12 years ago
I can't help but feel this is more of a job for an Asset library than a Template library. If we do this, we need to do CSS as well. Then we need to think about minification and grouping and all that jazz, which again is a job for an Asset library.
I'm with Phil on this one, a dedicated asset library would be the way to do this. It's not uncommon to find that you have to include page-specific assets in various places in a view (regardless of if it's templated or not).
i agree with @philsturgeon it must be the job for an asset library not the template library ..
would be nice if the template library can use the asset library in conjunction
I think that an Asset Library is a great idea - since all libraries can grow at some point, the code separation would help a lot in the development process.
Also, the overall overhead would be less, since it shouldn't load all the template AND asset methods all at once.
EDIT:
Also, what about extending the libraries? If someone would want to make modifications to the Asset handling, it shouldn't extend the Template library, too.
I think the separation would make a big difference - easier to integrate, easier to handle, easier to extend, easier to develop, IMHO.
But hey, that's just me =)
Feels very like a separate thing that should be handles by an asset manager however might be worth having an example of how to do this yourself without an asset manager as an example.
Thanks for the feedback guys. Shut!
Nice Topic I gotta agree with Phil on this one. The template lib should be written to be fast and light. The Asset lib will have a bunch of "power" features that begin to get out of scope for what a template library should handle.
Yeah keep them separate.
I totally agree with Phil dont know what i was thinking. I should have solve that with an asset library instead of this.
I needed to setup my template to load javascript files at the bottom of my body so i have added some methods to the library.
Hope you like it.