Git Product home page Git Product logo

cake-lessphp's Introduction

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.

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

Installation

Git Submodule

In your cakephp's root directory type

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

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

Composer

In your root cakephp, edit your composer.json to fit:

"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:

CakePlugin::load('CakeLess');

It doesn't need if you already have this line:

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.

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

Next, simply add the less files to your views:

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

or if the less file is located in the webroot of a plugin

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

or

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

cake-lessphp's People

Watchers

 avatar  avatar

Forkers

jumeda1 tytusd

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.