galvani/coffee-closure
Composer 安装命令:
composer require galvani/coffee-closure
包简介
README 文档
README
Symfony 2 bundle for coffee script support and google closure support
This package is dependent Michael's Bolin's coffee-script compiler
INSTALL
add these lines to composer.json:
"repositories": {
"bolinfest/coffee-script": {
"type": "package",
"package": {
"name": "bolinfest/coffee-script",
"version": "1.1",
"source": {
"url": "https://github.com/bolinfest/coffee-script.git",
"type": "git",
"reference": "origin/1.1.0"
}
}
}
}
register bundle in your AppKernel:
new Galvani\CoffeeClosureBundle\CoffeeClosureBundle()
add configuration options to your config:
coffee_closure:
bin: "/usr/bin/env coffee"
closure: "src/Galvani/PocketBoyBundle/Resources/public/js/"
src: "src/Galvani/PocketBoyBundle/Resources/public/coffee"
bundles: [ "GalvaniPocketBoyBundle" ]
The bundle will scan Resources/public/coffee and compile all .coffee files in Resources/public/js
Example of application entry point, which needs to be inside the Resources/public/js:
app.js:
goog.provide('app.start');
goog.require('goog.dom');
goog.require('pocketboy');
app.start = function() {
var pocketboyApplication = new pocketboy();
pocketboyApplication.start();
};
// Ensures the symbol will be visible after compiler renaming.
goog.exportSymbol('app.start', app.start);
and in you html simply add:
<script>goog.require('app.start'); app.start();</script>
twig example using assetic:
<script src="{{ asset('bundles/galvanipocketboy/js/closure-library/closure/goog/base.js') }}"></script>
<script src="{{ asset('bundles/galvanipocketboy/js/deps.js') }}"></script>
<script src="{{ asset('bundles/galvanipocketboy/js/app.js') }}"></script>
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-03-08