-
Notifications
You must be signed in to change notification settings - Fork 9
compile function returns base filename, not relative #15
Comments
I'm not really sure of what is the issue 😅 |
I'll give you a very simple example using the LessHelper is it's published. $lessOptions['parser']['cache_dir']='lesscache/';
$lessOptions['parser']['sourceMap'] =false;
$lessHTML = $this->Less->less("less/lessmain.less",$lessOptions);
$this->append('css_first', $lessHTML); Generates the code: <link rel="stylesheet" href="/css/lessphp_b2937d7179c3575767343f1956dab99c07d0a826.css"/> It should generate: <link rel="stylesheet" href="/css/lesscache/lessphp_b2937d7179c3575767343f1956dab99c07d0a826.css"/> Changing the ['cache_dir'] value to root relative generates the exact same HTML |
Ok, now I see. I'll try to fix it if I find a moment 😃 |
BTW, as in the other issue, I'm open to PRs. If you wanna fix it, I'll gladly merge the fix 😄. Just remember to add a test for that case if possible (if you don't know how to do it you can leave that part to me). |
the code I submitted works with:
I'm new to git, I still need to figure out how a PR works, when I do, I'll be happy to do it. |
I'll try to explain it in 'easy' steps:
When you push your changes, access your fork in github and github will say something about the PR. Just follow its instructions then. |
When using an optional $options['cache_dir'] parameter the CSS file that gets created will be created in that directory instead of the CSS directory.
However the \Less_Cache::Get function returns the basename() of the generated file.
The result of this problem is that the filename that gets passed to $this->Html->css a basename() and the filename that gets generated by \Less_Cache::Get is inside the ['cache_dir'] directory.
There are 3 scenarios.
The $this->compile() function looks like this:
Inside the $this->less() function looks like this:
The text was updated successfully, but these errors were encountered: