我正在使用 less 创建 css 文件。我正在使用 this插件
<?php
require "lessc.inc.php";
$less = new lessc;
$less->setVariables(array(
"base" => "968px"
));
$less->checkedCompile("webform.less", "output.css");
?>
当我第一次编译这段代码时...编译了 webform.less 中的基本变量并创建了准确的输出。但是当我编辑基值并编译时,它没有更新。我是否在使用 php 的 less 编译中遗漏了任何东西?
最佳答案
仅当输入文件不同或输出文件不存在时,checkedCompile() 方法才会编译。你必须使用函数 compileFile() 来一次又一次地编译它..
下面的代码可以解决这个问题..
<?php
require "lessc.inc.php";
$less = new lessc;
$less->setVariables(array(
"base" => "968px"
));
$less->compileFile("webform.less", "output.css");
?>
关于php - LESS php 不更新 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19097317/