canton7 / fuelphp-casset

Better asset management library for fuelphp (with minification!)
MIT License
103 stars 29 forks source link

Support Casset::get_filepath_*(array('jquery-1.7.1.js', 'jquery-1.7.1.min.js') #14

Closed antitoxic closed 12 years ago

antitoxic commented 12 years ago

Currently Casset::get_filepath_js accepts only a string which represents the relative filepath to the current asset path. This makes all environments to include either minified or non-minified.

It would be a useful addition to be able to call:

Casset::get_filepath_js(array('jquery-1.7.1.js', 'jquery-1.7.1.min.js')

where Casset will decide depending on environment which script path to return.

This is also applies to all get_filepath_* methods.

canton7 commented 12 years ago

An alternative to this would be to give a new argument to render_*, which would make it return the path to the relevant file, rather than the whole <script>/<link> tag.

This would offer the same power as your proposal, but would allow Casset to minify the relevant file if the user didn't have a pre-minified copy available.

What do you think?

antitoxic commented 12 years ago

render_* with an extra parameter will be nice! It does the job :)

canton7 commented 12 years ago

Take a look at the feature/gen_tags_option branch, see if it does what you want.

antitoxic commented 12 years ago

I had a read throught the README.

Thank you!

canton7 commented 12 years ago

Cool, it's been merged into develop.