Code Monkey home page Code Monkey logo

less-cake-plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

less-cake-plugin's Issues

fullBase Url

Hi,

I try to generate a css URL with full base.
How can I get this to work?

$this->Less->less('less/pdf.less', ['fullBase' => true]);

does not work.

thanks & regards
Dieter

compile function returns base filename, not relative

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.

  1. No $options['parser']['cache_dir']
  2. $options['parser']['cache_dir'] that begins with / relative to WWW_ROOT
  3. $options['parser']['cache_dir'] that does not begin with / relative to /css

The $this->compile() function looks like this:

if ($cache) {
   if( !isset($options['cache_dir'])){
      $options['cache_dir'] =$this->cssPath;
   } else if( substr( $options['cache_dir'], 0, 1 ) =='/'){
      $options['cache_dir']  = WWW_ROOT . $options['cache_dir'];
   } else {
      $options['cache_dir']  = trim($this->cssPath, '/') . $options['cache_dir'];
   }
   return \Less_Cache::Get($parse, $options, $modifyVars);
}

Inside the $this->less() function looks like this:

   $cache_dir = isset($options['parser']['cache_dir']) ? $options['parser']['cache_dir'] : "";
   $css = $cache_dir . $this->compile($less, $options['cache'], $options['parser'], $modifyVars);

Is there a way to remove compiled css files?

Not sure whether I can configure Less helper to remove old compiled css files.

At the moment, I have written my own tool. Would be OK for an APP but absolutely inconvenient for plugins.

CakePHP 3.0 - install on stable version

$ composer require elboletaire/less-cake-plugin

Using version dev-master for elboletaire/less-cake-plugin
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Can only install one of: cakephp/cakephp[3.0.x-dev, 3.0.0].
- Can only install one of: cakephp/cakephp[3.0.x-dev, 3.0.0].
- elboletaire/less-cake-plugin dev-master requires cakephp/cakephp 3.0.x-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
- Installation request for elboletaire/less-cake-plugin dev-master -> satisfiable by elboletaire/less-cake-plugin[dev-master].
- Installation request for cakephp/cakephp == 3.0.0.0 -> satisfiable by cakephp/cakephp[3.0.0].

Installation failed, reverting ./composer.json to its original content.

Support CackPHP 4

Is there any plan to support CakePHP 4? I can't upgrade my CakePHP because this package is dependent on CakePHP 3.

No way to add CSS Options

When Html->css is called on line 157, there is no way to set options.

I've made this small change which allows for setting Html->css options.

$cssOpt = isset($options['cssopt'] )?$options['cssopt']:[];
return $this->Html->css($css,$cssOpt);

CakePHP - plugins directory change

Hello, it's me again. :)

The CakePHP guys changed the plugin's directory in their latest commit. Now every plugin is saved into the vendor folder. So your plugin is working without problems, but only if I copy the LessHelper.php into \View\Helper directory.

If you will have some time, maybe you can look into it. :) Thanks!

Path to "less" files

Hi,

I have a little problem that I can't solve, when I try to pull my compiled less files in the css block, I got an error.

Here are the folders where are my files :

--webroot /
----css /
------style.css
------other.css
------less /
--------main.less
----js/
----img/

Here is the code I use :

echo $this->Html->css('less/main.less?', ['block' => true, 'rel' => 'stylesheet/less']);
echo $this->Less->fetch(); // it seems the problem comes from here
echo $this->fetch('css');

And the error :

FileError: 'http://localhost/my_project/my_project/css/less/main.less' wasn't found (404)

The correct path is, obviously, this one :

http://localhost/my_project/css/less/main.less

For a reason that I can't find, "my_project" is duplicated in the path.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.