I'm using lessphp in my Joomla website, I'm building a template, I'd like to set some variables and use them in a less file, to do that I'm using the class autoCompileLess but I'm getting the error
failed to parse passed in variable @font:
This мой код MessPHP: < /p>
require_once "lessc.inc.php";
$less = new lessc;
//$css_print .= $less->compile("body {font-family: @bfont;} .vikqt_box {font-family:@font;}");
// create a new cache object, and compile
function autoCompileLess($inputFile, $outputFile) {
// load the cache
$cacheFile = $inputFile.".cache";
if (file_exists($cacheFile)) {
$cache = unserialize(file_get_contents($cacheFile));
} else {
$cache = $inputFile;
}
$less = new lessc;
$less->setVariables(array(
"font" => $fontname,
"bfont" => $bfontname
));
$newCache = $less->cachedCompile($cache);
if (!is_array($cache) || $newCache["updated"] > $cache["updated"]) {
file_put_contents($cacheFile, serialize($newCache));
file_put_contents($outputFile, $newCache['compiled']);
}
}
autoCompileLess(JPATH_SITE.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.$this->template.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.less', JPATH_SITE.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.$this->template.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'output.css');
< /code>
< /pre>
Хотя, если я проверю файл output.css, я вижу свой .less File, скомпилированный правильно, чтобы я не понял, почему я получаю эту ошибку.
Кто -то мог мне посоветовать?
спасибо всем! < /p>
Подробнее здесь: https://stackoverflow.com/questions/394 ... able-error
MarsPhp не удалось проанализировать с ошибкой переменной ⇐ CSS
Разбираемся в CSS
-
Anonymous
1750243464
Anonymous
I'm using lessphp in my Joomla website, I'm building a template, I'd like to set some variables and use them in a less file, to do that I'm using the class autoCompileLess but I'm getting the error
failed to parse passed in variable @font:
This мой код MessPHP: < /p>
require_once "lessc.inc.php";
$less = new lessc;
//$css_print .= $less->compile("body {font-family: @bfont;} .vikqt_box {font-family:@font;}");
// create a new cache object, and compile
function autoCompileLess($inputFile, $outputFile) {
// load the cache
$cacheFile = $inputFile.".cache";
if (file_exists($cacheFile)) {
$cache = unserialize(file_get_contents($cacheFile));
} else {
$cache = $inputFile;
}
$less = new lessc;
$less->setVariables(array(
"font" => $fontname,
"bfont" => $bfontname
));
$newCache = $less->cachedCompile($cache);
if (!is_array($cache) || $newCache["updated"] > $cache["updated"]) {
file_put_contents($cacheFile, serialize($newCache));
file_put_contents($outputFile, $newCache['compiled']);
}
}
autoCompileLess(JPATH_SITE.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.$this->template.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.less', JPATH_SITE.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.$this->template.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'output.css');
< /code>
< /pre>
Хотя, если я проверю файл output.css, я вижу свой .less File, скомпилированный правильно, чтобы я не понял, почему я получаю эту ошибку.
Кто -то мог мне посоветовать?
спасибо всем! < /p>
Подробнее здесь: [url]https://stackoverflow.com/questions/39488096/lessphp-failed-to-parse-passed-in-variable-error[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия