nfq-alpha/sprite-bundle
最新稳定版本:1.0.2
Composer 安装命令:
composer require nfq-alpha/sprite-bundle
包简介
Generate sprites with PHP and twig templates
关键字:
README 文档
README
Generate sprite images and stylesheets with plain PHP and GD2 (no 3rd party dependencies)
Installation
Dependancies
PHP extension GD2
Get the bundle
Add this in your composer.json
{
"require": {
"nfq-alpha/sprite-bundle": "dev-master@dev"
}
}
and then run
php composer.phar update
Add the classes to your Kernel
new SpriteGenerator\SpriteGeneratorBundle(),
Configuration
You have to configure your sprites by adding lines to config.yml:
sprite_generator: sprites: spritename: inDir: %kernel.root_dir%/../src/Resources/public/img/sprites/ outImage: %kernel.root_dir%/../src/Resources/public/img/sprite2.png outCss: %kernel.root_dir%/../src/Resources/public/scss/_sprites2.scss relativeImagePath: ../bundles/img/ padding: 5 spriteClass: sprite cssFormat: sass imagePositioning: one-column imageGenerator: gd2 another_spritename: inDir: %kernel.root_dir%/../src/Resources/public/img/sprites/ outImage: %kernel.root_dir%/../src/Resources/public/img/sprite2.png outCss: %kernel.root_dir%/../src/Resources/public/scss/_sprites2.scss relativeImagePath: ../bundles/img/ padding: 5 spriteClass: sprite_another cssFormat: sass imagePositioning: one-column imageGenerator: gd2
Generate sprites
Generate all your sprites :
$ php app/console nfq:sprite:generate
Generate one sprite :
$ php app/console nfq:sprite:generate spritename
统计信息
- 总下载量: 38.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-09-11