Download the PHP package elboletaire/less-cake-plugin without Composer

On this page you can find all versions of the php package elboletaire/less-cake-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package less-cake-plugin

Less parser plugin for CakePHP 3.X

Build status Code coverage License Latest Stable Version Total Downloads Code Climate

This plugin has a helper to help you parsing .less files in CakePHP 3.0 applications.

By default, the helper will parse all less files to CSS files using less.php but if, for any reason, it fails, will fallback to the less.js parser both included by this plugin (this way you'll see any errors on screen).

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

After installing it you'll need to load it on your bootstrap.php file:

And load it into your (App)Controller:

Usage

By default it will compress files using the php parser with cache enabled. This will fill your css folder with a bunch of files starting with lessphp_ used for the cache. I recommend you adding these files to your .gitignore file in order to prevent commiting them:

lessphp_*

Basically, you give the helper a less file to be loaded (usually from /less directory) and it returns the html link tag to the compiled CSS:

You can compile multiple files if you pass an array:

Or you can load your less files with the HtmlHelper sending the files to the CSS block:

Note the ? at the end of the filename. It's used to force the .less extension. Otherwise it would be overwriten to styles.less.css by the UrlHelper.

And then parse all your files using the fetch method:

By default, any less file found will be removed from the css block and thus, not printed.

You can also pass any option to both less.js and less.php parsers:

If you want to use the less.js parser directly, instead of just as a fallback, or you want to use the #!watch method, you can do it so by setting the js parser to development:

This will output all the links to the less files and the needed js files to parse the content only using the less.js parser.

Note: if there is an error in the php parser the helper will fallback to the js parser so you can see the errors in screen. If, for any reason, you can't see those errors, check the error.log file in the logs folder; it will contain any error generated by the less.php parser.

To load less files inside plugins you can use plugin notation:

Options

Beside the options for less.js and less.php parsers you can set three options to the helper:

As a default setting of the LessHelper, all the CSS generated by the less.php parser is compresed. To override this set compress to false in the less.php parser options:

Modify Vars

Last but not least, if you want to overwrite any variable set on your less files you can use the $modify_vars param:

License

Copyright 2015 Òscar Casajuana (a.k.a. elboletaire)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
imitations under the License.

All versions of less-cake-plugin with dependencies

PHP Build Version
Package Version
Requires cakephp/cakephp Version ~3.0
oyejorge/less.php Version ~1.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package elboletaire/less-cake-plugin contains the following files

Loading the files please wait ....