Git Product home page Git Product logo

minify-for-croogo's Introduction

Minify plugin for CakePHP

Copyright 2012, Maury M. Marques Licensed under The MIT License Redistributions of files must retain the above copyright notice.

Minify

Minify is an application that combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.

More info: http://code.google.com/p/minify

For this plugin, the application Minify is inside Vendor

Version

Written for CakePHP 2.0+

Installation

You can clone the plugin into your project (or if you want you can use as a submodule):

cd path/to/app/Plugin or /plugins
git clone https://github.com/maurymmarques/minify-cakephp.git Minify

Bootstrap the plugin in app/Config/bootstrap.php:

<?php
CakePlugin::load(array('Minify' => array('routes' => true)));

Configuration

Set the configuration file in your app/Config/core.php

<?php
Configure::write('MinifyAsset', true);

If you do not want to use compression, set false.

Create a folder called "minify" in app/tmp/cache and give permission to read and write.

Usage

Enable the helper using the plugin syntax

<?php
class BakeriesController extends AppController {
    public $helpers = array('Minify.Minify');
}

This plugin uses HtmlHelper, and works virtually the same.

In the view you can use something like:

<?php
echo $this->Minify->css(array('default', 'global'));
echo $this->Minify->script(array('jquery', 'interface'));

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.