fffunction/twig-static
Composer 安装命令:
composer require fffunction/twig-static
包简介
A filter that takes a static file path and returns a URL versioned with the file hash
README 文档
README
composer require fffunction/twig-static
Usage
Add the filter to Twig:
$twig->addFilter('static', new Twig_Filter_Function( create_static_filter('path/to/assets/', '/url/to/prepend/') ));
Then pass paths to the filter in your templates:
{{ 'js/app.bundle.js' | static }}
{# /url/to/prepend/js/app.bundle.js?v=1a2b3c4 #}
API
create_static_filter(sting $asset_root, string $asset_url): function
$asset_root: a relative path from the app root to the assets root dir$asset_url: a path to prepend to the returned url
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-07