Are there any good implementations of Minify integration with Zend Framework? I’m looking for examples.
I’d love to have a plugin that overrides $this->headLink() and spits out the correct minified url/content.
Edit:
It seems most examples I find aren’t fully optimized in one form or fashion. I’m looking for a solution that meets the following requirements:
Reduces multiple links and script tags to one request (one for link and one for scripts)
The closest I’ve seen is a request path that passes a comma-delimited string to /min/ like so:
<script src="/min?f=file1.js,file2,js,file3.js" type="text/javascript"></script>
Why not something that combines all scripts into one file on disk on the fly and then caches it so that you aren’t doing the minification on every request?
<script src="/js/app.js?someRandomStringHere" type="text/javascript"></script>
The combining aspect should maintain order (in reference to prepend, append, etc)
While I don’t care so much about sending correct expires headers because I force gzipping, etags, and expires headers on the server-side, having that optional would be beneficial to other users.
Lastly, having a build script that generates the minified assets isn’t necessary bad – as long as it is easy to do and doesn’t require a code change after every build.
mmm , sorry i don’t have examples but i can help you explaining how ,
my simple workflow would be like this :
1- as a view helper
in your custom library folder , create a class that extends the static function of
my_minify::minify()you may create a viewhelper that override the functionality of both
headLink()andminfyclass2- as a plugin :
you might create plugin that runs
postdispatchto minify the whole resulting view , more explanation