alexandermatveev/jquery-bundle

Symfony2 的 jQuery Bundle

1.0 2017-06-16 08:17 UTC

This package is auto-updated.

Last update: 2024-09-09 21:26:49 UTC


README

当前版本

jQuery 3.2.1

安装

将bundle添加到您的composer.json文件中

// composer.json

{
    "require": {
		// ...
        "alexandermatveev/jquery-bundle": "*"
    }
}

将bundle添加到您的应用程序内核中

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new AlexanderMatveev\JQueryBundle\AlexanderMatveevJQueryBundle(),
        // ...
    );
}

使用Composer下载bundle

$ php composer.phar update alexandermatveev/jquery-bundle

安装资产

假设您的服务器的公共目录名为"web",安装公共供应商资源

$ bin/console assets:install web

可选地,使用--symlink属性创建链接而不是资源的副本

$ bin/console assets:install --symlink web

使用方法

在HTML模板中引用所需文件,例如

<script type="text/javascript" src="{{ asset('bundles/alexandermatveevjquery/lib/jquery-3.2.1.min.js') }}"></script>

许可证

请参考包含文件的源代码以获取许可证信息

参考

  1. https://jqueryjs.cn
  2. https://symfony.com.cn