承接 electblake/cakeless 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

electblake/cakeless

最新稳定版本:1.0.1

Composer 安装命令:

composer require electblake/cakeless

包简介

A very simple plugin for using phpless (a LESS php implementation) in CakePHP

README 文档

README

This plugin is a very simple implementation of lessphp for CakePHP 2.x.

To use Cakeless download and unzip the plugin or clone git repository in plugins/cakeless.

Using the plugin

In your Controllers or App Controller

Load plugin in bootstrap.php (for CakePHP 2.x):

CakePlugin::load('Cakeless');

Include the component using:

public $components = array('Cakeless.Cakeless');

Indicate the .less file you want to compile and the desired location and filename for the compiled file. For example:

$lessExample = APP . 'plugins' . DS . 'cakeless' . DS . 'webroot' . DS . 'less' . DS . 'example.less';
$cssExample = APP . 'plugins' . DS . 'cakeless' . DS . 'webroot' . DS . 'css' . DS . 'example.css';

$this->Cakeless->compile( $lessExample, $cssExample );

This will compile the provided example file (/app/plugins/cakeless/webroot/less/example.less) to /app/plugins/cakeless/webroot/css/example.css. This could be used for testing purposes but you may want to see a more real life example. Here you have it:

$lessMainStyles = WWW_ROOT . 'less' . DS . 'main_styles.less';
$cssMainStyles = WWW_ROOT . 'css' . DS . 'main_styles.css';

$this->Cakeless->compile( $lessMainStyles, $cssMainStyles );

IMPORTANT NOTE: Compilation will only occur under debug modes 1 and above of your CakePHP application.

In your Views

Simply link to the CSS file as usual:

echo $this->Html->css( 'main_styles', null, array( 'media' => 'screen, projection' ) );

Requirements

  • PHP version: PHP 5.2+
  • CakePHP version: Cakephp 2.x Stable
  • lessphp version: 0.3.5 (no need to download, included in /vendors folder)

Support

For support and feature request, please use the repository Issues section at GitHub.

About LESS and lessphp

If you want to know more about LESS syntax please check the official LESS documentation. For lessphp extended documentation and downloads please visit the official lessphp website.

License

Copyright (c) 2011 Sebastián Veggiani, http://actionauta.com

Licensed under The MIT License (MIT)
Redistributions of files must retain the above copyright notice.

Copyright

Copyright 2011
Sebastián Veggiani

统计信息

  • 总下载量: 421
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固