开发者

php template compiler similar to google+?

hello is there any template engine or maybe a compiler like the one Google+ use? i dont know i think they use closure, or GWT or something, but its really neat to see the html ids and css compile into

A-B-C-D

is there anything out there similer?

php template compiler similar to google+?

If it doesn't exist, is t开发者_运维百科here anyway to achieve this? like the logic or algorithm, books? thanks!


It depends on what your goal is. Are you looking for something that renders your code as you type? So that you can instantly see the changes you make? If I understand your question, you're looking for an IDE (an "integrated development environment" - a code editor) that will display a preview of your output as you code. If this is what you're asking, I like Coda, but it's a Mac-Only solution. Odds are you're a PC user, so the closest option I've found on the PC is Dreamweaver. Unfortunately both are expensive.

So you're other (cheaper) rout is an IDE with your page opened up in a separate browser window that you can refresh. Komodo, BBEdit, and TextWrangler are some other excellent IDE's.


I do not know how exactly their "compiler infrastructure" works. But it looks like they combine html & css creation into a single templating engine. Maybe (probably) based on Google Closure Compiler.

But it most probably is not just a single tool that you can apply on some HTML templates, it probably is a whole kind of framework.

To accomplish something similar, you could for example create (or use) a templating engine, combined with a set of "release creation" scripts. Those will parse and compile the templates and simultaneously create a mapping of original (dev code style) css class names to compressed css class names. After processing all templates of an "app release source tree", the release scripts will finally create the "compiled templates" and appropriate stylesheet files using the compressed css class names.

However, I highly recommend some kind of "release creation scripts" for any large web application project anyway! Those scripts can pre-compile templates, apply such css class name compression, create subsumed php scripts (to avoid many includes on each request on a production server) and much much more. This allows high-performance web applications in an interpreted (PHP) environment.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜