kohana-modules/minify 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

kohana-modules/minify

Composer 安装命令:

composer require kohana-modules/minify

包简介

Minify module for Kohana 3.x

README 文档

README

For Kohana 3.2, use the 3.2 branch, the only thing that changes is the case on the filenames

It's a Minify module based on the best minifier for PHP imho > https://github.com/mrclay/minify Extract the contents to 'modules' folder, enable it in the bootstrap:

  Kohana::modules(array(
    'minify' => MODPATH.'minify', // Minify
  ));

and the only thing you need to do actually, is to create a subfolder on 'application/cache' called minify, and you're ready to go (otherwise you'll get problems with the file cache). Call it in your HTML files like:

  <link href="/min?f=file1.css,file2.css,file3.css&b=/css/" rel="stylesheet">

Don't forget to copy the file modules/minify/config/minify.php to your applications folder in application/config/minify.php

Don't make modifications inside the modules folder

It's already configured with a route called minify, that maps to '/min', and if you don't want to output what is your js or css folder, you can use groups, by specifying it in your /application/config/minify.php file:

in PHP:

  return array(
    'groupsConfig' => array(
      'css' => array('//css/file1.css', '//css/file2.css', '//css/file3.css'),
      'js' => array('//js/jquery.js', '//js/modernizr.js', '//js/plugin/orbit.js')
    )
  );

in HTML:

<link href="/min?g=css" rel="stylesheet">

You may call groups like:

<link href="/min/css" rel="stylesheet">

Kohana style:

<?php echo html::style('min?g=css') // or html::style('min/css') ?>

Debugging

Append ?debug=1 to your min/ URL, it will show you what's going on in your file.

Have fun!

统计信息

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

GitHub 信息

  • Stars: 51
  • Watchers: 5
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2012-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固