集成/资产包

0.7 2017-04-18 08:56 UTC

README

本扩展包提供资产管理功能

要求

  • 请查看 composer.json 中的 require 部分

特性

  • 资产管理

文档

安装

按照以下步骤安装本扩展包

使用 composer 安装

$ php composer.phar require integrated/asset-bundle:~0.5

启用扩展包

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Integrated\Bundle\AssetBundle\IntegratedAssetBundle()
        // ...
    );
}

示例

添加内联样式

{% integrated_stylesheets inline=true %}
    body { background: red; }
    p { font-size: 10px }
{% endintegrated_stylesheets %}

添加外部样式表

{% integrated_stylesheets
    'bundles/app/css/styles.css'
    'bundles/app/css/styles2.css' %}
{% endintegrated_stylesheets %}

前置 JavaScript

{% integrated_javascripts mode='prepend'
    'bundles/app/js/script.js' %}
{% endintegrated_javascripts %}

渲染样式表

{{ integrated_stylesheets() }}  

渲染 JavaScript

{{ integrated_javascripts() }}

许可协议

本扩展包采用 MIT 许可协议。请查看扩展包中的完整许可协议

LICENSE

贡献

欢迎提交 pull request。请参阅我们的 CONTRIBUTING 指南

关于

本扩展包是 Integrated 项目的一部分。您可以在 Integrated for Developers 网站上了解更多关于此项目的信息。