uz/yii2-momentjs

为 Yii2 提供的 MomentJS 资产

安装次数: 20,714

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 1

开放问题: 0

类型:yii2-extension

v1.0.2 2017-10-19 14:50 UTC

This package is not auto-updated.

Last update: 2024-09-15 05:08:01 UTC


README

提供资产包以便将 moment 简单集成到您的 Yii2 应用程序中。

安装

安装此扩展的首选方式是通过 composer

运行以下命令

composer require --prefer-dist "uz/yii2-momentjs:*"

或者将以下内容添加到您的 composer.json 文件的 require 部分中。

"uz/yii2-momentjs": "*"

使用方法

在视图文件中注册资产

// Register only core momentjs with no locale data
\uz\momentjs\MomentJsAsset::register($this);

// Register core momentjs with current app locale. Current locale is activated on DOM ready.
\uz\momentjs\MomentJsLocaleAsset::register($this);

// Register core momentjs with all locales supported by the momentjs.
\uz\momentjs\MomentJsAllLocalesAsset::register($this);

许可证

MIT 许可证。请参阅 许可证文件 以获取更多信息。