registerFunctions just like in lessphp
Permalink
Hi all,
first off I am using Core Version - 8.1.0 and wanted to thank you all in advance for hopefully help.
lessphp has an extension interface where you can implement user functions that will be exposed in LESS code during the compile. This is done by: "registerFunction"
Concrete implemented this function in Less\Parser.php. Now I wanted to use this by simply calling
right before the compile-function is called in the getCss-Method.
I added the above simple function at the end of Parser.php as well as in the Functions.php... to be sure ... :)
Also this is the testclass in main.less:
Unfortunately it doesnt work...
Does somebody have a hint for me?
Greetings
Marcel
first off I am using Core Version - 8.1.0 and wanted to thank you all in advance for hopefully help.
lessphp has an extension interface where you can implement user functions that will be exposed in LESS code during the compile. This is done by: "registerFunction"
Concrete implemented this function in Less\Parser.php. Now I wanted to use this by simply calling
$this->registerFunction('toURL','to_loadCachePath');
right before the compile-function is called in the getCss-Method.
public function to_loadCachePath($url) { return $url; }
I added the above simple function at the end of Parser.php as well as in the Functions.php... to be sure ... :)
Also this is the testclass in main.less:
.myClass { background: url(toURL('http://toxxs-analyzer.3t-analytik.de/responsive_file/1/50/50/prozent')); }
Unfortunately it doesnt work...
Does somebody have a hint for me?
Greetings
Marcel