开发者

LESS compiler for PHP [closed]

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libr开发者_开发百科aries, and more. You can edit the question so it can be answered with facts and citations.

Closed 1 year ago.

Improve this question

I'm trying to compile LESS from PHP and don't want to use node.js or ruby.

There's this PHP implementation I found through Google but it seams really outdated and lacks support for newer features.

I was thinking of using the V8js API to run less.js, would that work since it has no DOM support?

Basically my question is: How can I run this JS file from a PHP application?


Here's the answer:

https://github.com/leafo/lessphp

There's no other way for the moment.


If you want completely hands-free LESS compiling, try Relayer:

http://relayer.co

It's free and very simple to use.


You can use PhpLessDemandBridge for that

You can simply use it in your Templates, like:

<link rel="stylesheet" type="text/css" media="all" href="css/engine/css.php?file=bootstrap.less" />

The Engine can be configured via config file, where you define your path to the less files and cache files.

By defining "css.php?file=bootstrap.less", you point the Engine to the bootstrap file, which imports other less files e.g. Twitter Bootstrap or such.

I am using this for Magento, TYPO3 CMS and many more.

In the first line, i am including needed parts of Twitter Bootstrap - after that i am including my own theme and overrides.


Good news! We have new Less compiler for this case: https://github.com/wikimedia/less.php

It has no namespace issues and is easy enough to add and use.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜