This Slim Framework middleware will compile LESS CSS files on-the-fly using the Assetic library

Overview

This Slim Framework middleware will compile LESS CSS files on-the-fly using the Assetic library. It supports minification and caching, also via Assetic.

It will intercept requests for CSS files and attempt to find a corresponding LESS file. If one is found, it will compile the file to CSS and serve it, optionally saving the CSS to a filesystem cache. Inspired by less.js-middleware.

Usage

  • src - Directory to look for LESS files. REQUIRED Example: if src is set to /path/to/public, and a request for http://mysite.com/css/style.css is received, then it will look for a LESS file in /path/to/public/css/style.less.
  • cache - Cache CSS file to filesystem. Default is true.
  • cache.dir - Directory for the cached CSS file. Default is src.
  • minify - Minify the CSS output. Default is true.
  • debug - Send debug messages to Slim Logger. Default is false.

Example:

use \Slim\Slim;
use \Slim\Middleware\Less;

$app = new Slim();
$app->add(new Less(array(
    'src' => '/path/to/public',
    'cache' => true,
    'cache.dir' => '/path/to/cache',
    'minify' => true,
    'debug' => false
)));
You might also like...
PHP boilerplate for quick start projects using Slim Framework and Eloquent.
PHP boilerplate for quick start projects using Slim Framework and Eloquent.

Lassi PHP boilerplate for quick projects using Slim Framework and Eloquent database. Lassi is a small PHP boilerplate to use Slim Framework with Eloqu

Parses YAML files and adds them to Slim's config application instance method.

Slim Config - YAML Parses YAML files and adds them into Slim's config singleton. Uses Symfony's YAML Component to parse files (http://github.com/symfo

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim Framework Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. Installation It's recommended

Slim Framework - Prerequisite Checker
Slim Framework - Prerequisite Checker

Slim Framework - Server Configuration Checker Upload the file check.php to your webserver Browse to the file: https://example.com/check.php Check the

A Slim PHP MVC framework built just for fun!

Aura Framework A Slim PHP MVC framework built just for fun! en: Note: This repository only contains the core code of the Aura framework. If you want t

Slim Framework skeleton application with MVC Schema

Slim Framework skeleton application with MVC Schema

A curated list of awesome tutorials and other resources for the Slim micro framework

Awesome Slim A curated list of awesome tutorials and other resources for the Slim micro framework Table of Contents Essentials Tutorials Packages and

Slim Framework 3 Skeleton Application + PagSeguro Lib

Slim Framework 3 Skeleton Application + PagSeguro Lib Aplicação simples para geração do Token para pagamentos no PagSeguro (método transparente) e env

Comments
  • Require not satisfiable by natxet/cssmin

    Require not satisfiable by natxet/cssmin

    During the installation of the package with composer I get:

    php composer.phar require hellogerard/less-slim-middleware Please provide a version constraint for the hellogerard/less-slim-middleware requirement: dev-master 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 - Installation request for hellogerard/less-slim-middleware dev-master -> satisfiable by hellogerard/less-slim-middleware[dev-master]. - hellogerard/less-slim-middleware dev-master requires natxet/cssmin dev-master#9801e2a0de7ae252ca4f2b85542d75a82047a8b4 -> no matching package found.

    opened by emilioastarita 2
  • dependency on natxet/cssmin broken

    dependency on natxet/cssmin broken

    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Installation request for hellogerard/less-slim-middleware 0.1.0 -> satisfiable by hellogerard/less-slim-middleware[v0.1.0].
        - hellogerard/less-slim-middleware v0.1.0 requires natxet/cssmin dev-master#9801e2a0de7ae252ca4f2b85542d75a82047a8b4 -> no matching package found.
    
    opened by matthewbaggett 1
Releases(v0.1.0)
Owner
Gerard Sychay
Gerard Sychay
Juliangut Slim Framework Doctrine handler middleware

Juliangut Slim Framework Doctrine handler middleware Doctrine handler middleware for Slim Framework. Slim3 version Doctrine integration service for Sl

Julián Gutiérrez 6 Mar 23, 2021
Access control middleware for Slim framework

Slim Access Access control middleware for Slim framework. Supported formats IPv4 and IPv6 addresses CIDR notation all keyword Installation composer re

Alexandre Bouvier 7 Oct 22, 2019
Redis cache middleware for Slim framework

RedisCache Redis cache middleware for Slim framework. Installation composer require abouvier/slim-redis-cache Usage Cache every successful HTTP respo

Alexandre Bouvier 16 Sep 20, 2021
Slim Framework HTTP cache middleware and service provider

Slim Framework HTTP Cache This repository contains a Slim Framework HTTP cache middleware and service provider. Install Via Composer $ composer requir

Slim Framework 107 Dec 15, 2022
CORS Middleware for PHP Slim Framework

CorsSlim Cross-origin resource sharing (CORS) Middleware for PHP Slim Framework. Usage Composer Autoloader Install with Composer Update your composer.

Palani Kumanan 92 Nov 30, 2021
PHP slim framework middleware to minify HTML output

slim-minify Slim middleware to minify HTML output generated by the slim PHP framework. It removes whitespaces, empty lines, tabs beetween html-tags an

Christian Klisch 35 Oct 31, 2021
Slim Framework CSRF protection middleware

Slim Framework CSRF Protection This repository contains a Slim Framework CSRF protection PSR-15 middleware. CSRF protection applies to all unsafe HTTP

Slim Framework 302 Dec 11, 2022
Code generation with logic-less templates for Yii

Caviar Code generation with logic-less templates for Yii. Caviar vs Gii You might be wondering why you should use Caviar instead of Gii, so let us tak

Christoffer Niska 10 Dec 19, 2015
REST APIs using Slim framework. Implemented all CRUD operations on the MySql database

PHP REST API using slim framework and CRUD operations ?? Hi there, this is a simple REST API built using the Slim framework. And this is for the folks

Hanoak 2 Jun 1, 2022
Slim Framework using Jade for templates

Welcome to Slim-Jade What? This is a boilerplate. It's the Slim Framework with jade.php to render views Why? I like the Sinatra style MVC and love Jad

Joe Fleming 23 Oct 16, 2019