2017 © Pedro Peláez
 

cakephp-plugin cakephp-less

Cakephp Less CSS compiler (forked from cakephp/less because of leafo/lessphp doesn't compatible with Twitter Bootstrap 3. Now oyejorge/less.php is being used instead)

image

songphi/cakephp-less

Cakephp Less CSS compiler (forked from cakephp/less because of leafo/lessphp doesn't compatible with Twitter Bootstrap 3. Now oyejorge/less.php is being used instead)

  • Thursday, May 15, 2014
  • by ycicom
  • Repository
  • 1 Watchers
  • 0 Stars
  • 96 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 18 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

LESS Helper

This little Helper converts your .less files into .css without relying on Node.js or client-side parsing. Everything is compiled on the server, cached, and served as regular css through PHP., (*1)

Forked from flug/CakeLess because of leafo/lessphp doesn't compatible with Twitter Bootstrap 3. Now oyejorge/less.php is using instead, (*2)

Installation

Git Submodule

In your cakephp's root directory type, (*3)

git submodule add https://github.com/SongPhi/cake-lessphp.git app/Plugin/CakeLess
git submodule init
git submodule update

Git clone

In your cakephp's root directory type, (*4)

git clone https://github.com/SongPhi/cake-lessphp.git app/Plugin/CakeLess

Composer

In your root cakephp, edit your composer.json to fit:, (*5)

"require": {
    "composer/installers": "*",
    "songphi/cakephp-less": "dev-master",
    "oyejorge/less.php": "~1.7"
},
"extra": {
    "installer-paths": {
        "app/Plugin/{$name}/": ["songphi/cakephp-less"]
    }
}

Plugin Loading

In your app/Config/bootstrap.php add this line:, (*6)

CakePlugin::load('CakeLess');

It doesn't need if you already have this line:, (*7)

CakePlugin::loadAll();

Create cache and less folders

  • Create a folder app/webroot/less
  • Create a folder app/tmp/cache/less
  • Apply chmod 777 to your css folder. (The Less Helper will place all compiled css files in your css-directory)

Usage

Where you want to use LESS files, add the helper. Usually this will be your AppController., (*8)

public $helpers = array('CakeLess.Less');

Next, simply add the less files to your views:, (*9)

echo $this->Less->css('yourfile');

or if the less file is located in the webroot of a plugin, (*10)

echo $this->Less->css('yourfile',array('plugin' => 'PluginFolderName'));

or, (*11)

echo $this->Less->css(array(
        'bootstrap/bootstrap',
        'prettify',
    )
);

The Versions

15/05 2014

dev-master

9999999-dev

Cakephp Less CSS compiler (forked from cakephp/less because of leafo/lessphp doesn't compatible with Twitter Bootstrap 3. Now oyejorge/less.php is being used instead)

  Sources   Download

MIT

The Requires

 

cakephp less songphi

14/05 2014

1.0

1.0.0.0

Cakephp Less CSS compiler (forked from cakephp/less because of leafo/lessphp doesn't compatible with Twitter Bootstrap 3. Now oyejorge/less.php is being used instead)

  Sources   Download

MIT

The Requires

 

cakephp less songphi