stinger / moment-js-bundle
Symfony2 Bundle Moment.js - 在JavaScript中解析、验证、操作和显示日期
2.10.3
2015-07-01 07:06 UTC
Requires
- symfony/framework-bundle: >=2.1
This package is auto-updated.
Last update: 2024-09-07 06:57:23 UTC
README
Symfony2的Moment.js Bundle
当前版本
Moment.js v2.10.3
安装
将bundle添加到composer.json文件中
// composer.json { "require": { // ... "stinger/momentjs-bundle": "~2.10" } }
将bundle添加到应用程序内核中
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Stinger\MomentJsBundle\StingerMomentJsBundle(), // ... ); }
使用Composer下载bundle
$ php composer.phar update stinger/momentjs-bundle
安装资源
假设您的服务器公共目录名为"web",安装公共供应商资源
$ php app/console assets:install web
可选地,使用--symlink属性创建链接而不是资源的副本
$ php app/console assets:install --symlink web
使用方法
将CSS和JS文件添加到所需的位置
{% javascripts 'bundles/stingermomentjs/js/moment-with-locales.min.js' %} <script src="{{ asset_url }}" ></script> {% endjavascripts %}
许可证
有关许可证信息,请参阅包含文件的源代码