承接 netzmacht/assetic-autoprefixer 相关项目开发

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

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

netzmacht/assetic-autoprefixer

Composer 安装命令:

composer require netzmacht/assetic-autoprefixer

包简介

autoprefixer-php filter for kriswallsmith/assetic

README 文档

README

Version Stable Build Status Upstream Build Status License Downloads

Autoprefixer filter

This is a filter implementation to use Autoprefixer within the PHP assetic framework.

Requirements

kriswallsmith/assetic is required to be installed in your php project. postcss/autoprefixer is required to be installed on your system.

Install kriswallsmith/assetic with composer

php composer.phar require kriswallsmith/assetic ~1.0

Install autoprefixer globally on your system

sudo npm install -g autoprefixer

Install autoprefixer locally on your system

npm install autoprefixer

Usage in PHP

use Bit3\Assetic\Filter\Autoprefixer\AutoprefixerFilter;

// if you have installed autoprefixer globally
$autoprefixerBinary = '/usr/bin/autoprefixer';

// if you have installed autoprefixer locally
$autoprefixerBinary = '/../node_modules/.bin/autoprefixer';

$autoprefixerFilter = new AutoprefixerFilter($autoprefixerBinary);

// if node.js binary is not installed as /usr/bin/node
// (e.g. on debian/ubuntu the binary is named /usr/bin/nodejs)
$autoprefixerFilter->setNodeBin('/usr/bin/nodejs');

Usage in Symfony2

This project comes with a assetic filter configuration file, located in the config directory.

Define the autoprefixer binary path in the parameters.yml:

parameters:
  # if you have installed autoprefixer globally
  assetic.autoprefixer.bin: /usr/bin/autoprefixer

  # if you have installed autoprefixer locally
  assetic.autoprefixer.bin: %kernel.root_dir%/../node_modules/.bin/autoprefixer

  # if node.js binary is not installed as /usr/bin/node
  # (e.g. on debian/ubuntu the binary is named /usr/bin/nodejs)
  assetic.node.bin: /usr/bin/nodejs

Then enable the filter in the assetic configuration chapter:

# Assetic Configuration
assetic:
    filters:
        autoprefixer:
          resource: "%kernel.root_dir%/../vendor/netzmacht/assetic-autoprefixer/config/autoprefixer.xml"
          # if you like, you can use apply_to here :-)
          # e.g, apply_to: "\.css"
          # otherwise you use the filter in your template with filter="autoprefixer"

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-05