Welcome Guest, Not a member yet? Register   Sign In
Carabiner 1.2: Asset Management Library
#31

[eluser]Tom Schlick[/eluser]
nice i like it! one thing i and currently hacking it to do is just output an array of the filenames instead of adding the domain and echoing a tag. this is because we have a total of five enviroments

Dev, Test, Alpha, Beta, Live

and we have one domain for assets
so assets.domain.com

so on each of those i have a foreach that will run through the css files that carabiner outputs and plug them into the src

actually thinking about that a little more will that cause any problems? currently we have the resources folder on each domain that the css and js is located in. and what im going to do is create the cache on assets.ourdomain.com that all the domains will cache into. will they overwrite each other?
#32

[eluser]tonydewan[/eluser]
I don't think so. The cache file name is created by appending the last modified date string (most recent in the case of multiple files) to an MD5 hash of the filename(s) string. As long as the filenames (or even the order of the files) is different, the filename will be different. If the filename is the same, the file will be overwritten.

You might be able to get away with just setting the base_uri (and/or maybe the style_path/script_path) property to an empty string. I'd have to see a little more about your setup to know if that would actually work, though.

Would it be useful for Carabiner to provide an option to output an array rather than tags? Perhaps something like
Code:
$this->carabiner->display_array('css');

Thanks for the interest and feedback.
#33

[eluser]Tom Schlick[/eluser]
i just put them each in their own subfolder to be safe.

as for the array yes thats exactly what i mean.

and have the different options in the array such as the media type, the name without the domain in front of it, etc.

again though nice work! in less than an hour of actual work i got it working for 5 different environments.
#34

[eluser]tonydewan[/eluser]
I'm glad it's working well for you! I'll look at adding the display_array function in the next release.
#35

[eluser]tonydewan[/eluser]
For those of you interested, Carabiner has been updated to version 1.42, with new features including asset group and predefined assets of popular JavaScript Libraries! See the new thread for more info and to download.
#36

[eluser]Radou[/eluser]
Hi tony,

Thanks dude for this great library.
I have a question on the best way to make the most of it.

I have a lot of css and javascripts that I call in several controllers, I use my header and footer in a lot of controllers since the returned $data array vary depending on the task called.

My question is : Is it possible to create a specific controller to minify/compress all css ans js files in my header and footer and make a single call in my controllers to call it.

I want to keep this structure for all controllers

Code:
$this->load->vars($data);
$this->load->view('header');
$this->load->view('view');
$this->load->view('footer');

and may be call the carabiner action in the index ?

Is it possible ?

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB