PHP code example of drips / less
1. Go to this page and download the library: Download drips/less library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
drips / less example snippets
use Drips\Less\Compiler;
$less_file = "path/to/file.less";
$css_file = "path/to/style.css";
// Inhalt der LESS-Datei auslesen
$less = file_get_contents($less_file);
// LESS mithilfe des LessCompilers in CSS übersetzen
$compiler = new Compiler;
$css = $compiler->compile($less);
// CSS-Code in die jeweilige Datei schreiben
file_put_contents($css_file, $css);
$router->add('less', '/css/{file}.css', Drips\Less\Controller::class);