Carabiner 1.4: Asset Management Library |
[eluser]PoetaWD[/eluser]
A JavaScript packer like this would be a nice addition to carabiner !!! http://dean.edwards.name/packer/ Or the php version: http://joliclic.free.fr/php/javascript-p.../index.php
[eluser]kdoole[/eluser]
Hi, Not exactly sure what I'm doing wrong here, but I can't seem to separate out the js and the css. I have tried display('js') and tried putting the files into separate groups, yet, for some reason, whichever i display first spits out both js and css. So if i would like to put the scripts at the bottom of the page (which i do) i'm out of luck. display('css') gives both css and js, then echo a variable of $script at the bottom of the page gives an undefined variable. from the controller: Code: $resources['css'] = $this->carabiner->display('css'); then in the view: <?php echo $css; ?> gives CSS and JS <?php echo $script; ?> $script is undefined variable. I am using 1.42 because 1.45 wouldn't work, possibly because i have am working on an older site and have not upgraded Codeigniter core yet. Any ideas???? Thanks!! Awesome Lib!!!!!!!!!!!!!!
[eluser]kdoole[/eluser]
Hmm... figured it out. apparently, passing the display() function into variables doesn't work. If I had both display('css') and display('js') in the same controller, no matter if they were going into separate variables, both css and js would go into the first one. BUT if the function is called in the view, there's no problem. Never mind!!!! Really really really really really useful library! THANK YOU!
[eluser]liri[/eluser]
Extending/adding assets - Is it possible for a controller/module to add it's own js/css with the asset library?
[eluser]pickupman[/eluser]
Yes, i've added assets in the controller before. Just do as you would in the view. $this->carabiner->js();
[eluser]liri[/eluser]
Thanks. How does Carabiner differs from codeigniter-asset lib? (http://github.com/philsturgeon/codeigniter-asset)
[eluser]pickupman[/eluser]
Similar concept, however, carabiner is a little more powerful. It will combine and minify your js and css and cache them. Phil's library just allows a cleaner way to add the url's to your page.
[eluser]liri[/eluser]
More questions: 1. Doesn't Carabiner handles image assets as well? (for easy printing of those) 2. If I also have assets like css/js and images not in the CI front controller directory but rather inside the application/modules or so, how is it possible to specify them and extends the css view within the controller that deals with those? 3. Doesn't Carabiner support stylesheet's syntax? such as, how would you specify (notice it's the stylesheet alternative: Code: <link rel="stylesheet alternative" type="text/css" href="test.css" media="screen" title="Print Preview" /> Thanks, just trying to choose the right lib to use :-)
[eluser]pickupman[/eluser]
Only way to figure out the right one to use, is to try them. I am not of fan of putting stylesheets and scripts in the modules folder. Why not keep them in subfolders of the appropriate assets directory?
[eluser]liri[/eluser]
Because one of the application's goal is to be modular, so that modules can later be added (modules=controllers adding new pages to the application), and these may or may not require to add their own css/js/images |
Welcome Guest, Not a member yet? Register Sign In |