philsturgeon / codeigniter-template

Template library for CodeIgniter which supports modules, themes, partial views, etc.
411 stars 178 forks source link

I have added additional support for js #26

Closed sirfilip closed 12 years ago

sirfilip commented 12 years ago

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.

philsturgeon commented 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.

jacksonj04 commented 12 years ago

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).

zaherg commented 12 years ago

i agree with @philsturgeon it must be the job for an asset library not the template library ..

chonthu commented 12 years ago

would be nice if the template library can use the asset library in conjunction

AeroCross commented 12 years ago

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 =)

coldclimate commented 12 years ago

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.

philsturgeon commented 12 years ago

Thanks for the feedback guys. Shut!

dmyers2004 commented 12 years ago

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.

silentworks commented 12 years ago

Yeah keep them separate.

sirfilip commented 12 years ago

I totally agree with Phil dont know what i was thinking. I should have solve that with an asset library instead of this.