Asset Pipeline/Framework for PHP

随声附和 提交于 2019-12-03 11:48:29

Liek hakre said, Assetic works out of the box. You do not need any templating system (Twig, Smarty...) for it works.

With a templating system, Twig is the best because, like hakre said, it's strongly implemented. However, it's not that diffucult to integrate it into any other template system (I quickly wrote a Smarty plugin for personnal use, it works well).

Finaly Assetic does anything you need :

  • Combine JS/CSS : done with the AssetCollection class (has show here)
  • Minify : here you'll use the filters Assetic provides : CssMin, JsMin, JsMin+, Google Closure Compiler, you've got the choise. There even are image fitler for image optimization (mainly quality lossless size reduction)
  • Cache : Assetic has a cache system so you don't have to create one by yourslef.

The last advantage that goes to Assetic is that it's the one used by default in Symfony2, which is, imo, one of the best PHP framework lately, so it proves that Assetic is a good choice.

Only problem I had so far using Assetic out of Symfony was the lack of documentation (the usage of the CssRewriteFilter in my case) but good understanding of the source code often helps getting how it's supposed to work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!