mg-code / yii2-assets
Yii2 asset collection of useful JavaScript libraries
Installs: 15 659
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
Suggests
- bower-asset/awesome-grid: Adds `awesome-grid` plugin support.
- bower-asset/blueimp-file-upload: Adds `jQuery File Upload` plugin support.
- bower-asset/corejs-typeahead: Adds `CoreJS TypeAhead` plugin support.
- bower-asset/fancybox: Adds `Fancybox` plugin support.
- bower-asset/highcharts-release: Adds `Highcharts` plugin support.
- bower-asset/history.js: Adds `history.js` plugin support.
- bower-asset/intl: Adds `Intl.js` plugin support.
- bower-asset/jquery-easing-original: Adds `jQuery Easing` plugin support.
- bower-asset/jquery-serialize-object: Adds `jquery-serialize-object` plugin support.
- bower-asset/jquery.are-you-sure: Adds `jquery.are-you-sure` plugin support.
- bower-asset/jquery.browser: Adds `jquery.browser` plugin support.
- bower-asset/js-cookie: Adds 'JavaScript Cookie' plugin support.
- bower-asset/messageformat: Adds `messageformat.js` plugin support.
- bower-asset/owl.carousel: Adds `owl.carousel` plugin support.
- bower-asset/react: Adds `ReactJs` plugin support.
- bower-asset/seiyria-bootstrap-slider: Adds `seiyria-bootstrap-slider` plugin support.
- bower-asset/sly: Adds `sly` plugin support.
- bower-asset/sticky: Adds `sticky` plugin support.
This package is auto-updated.
Last update: 2024-10-27 04:03:04 UTC
README
Yii2 asset collection of useful JavaScript libraries.
Below are instructions how to use assets.
You must include dependencies in your composer.json for all assets (see Assets section) that you want to use. This is due to prevent loading dependency packages for assets that you don't need.
Assets:
- Awesome Grid
- BxSlider
- History.js
- Intl.js
- Ionicons
- jQuery.browser
- jQuery Serialize Object
- JavaScript Cookie
- Sly
- Sticky
- Owl Carousel
- Owl Carousel 2 Thumbnails
- Are You Sure?
- Bootstrap Tabdrop
- Autobahn JS
- Seiyria Bootstrap Slider
- Highcharts
- messageformat.js
- Fancybox
- Enhanced Events
- ReactJS
- Single Page Nav
- jQuery Easing
- CoreJS TypeAhead
- jQuery File Upload
Install
Either run
$ php composer.phar require mg-code/yii2-assets "@dev"
or add
"mg-code/yii2-assets": "@dev"
to the require
section of your composer.json
file.
Install dependencies
See Assets section, there are described what dependencies you need to include for every asset.
To add those dependencies either run
$ php composer.phar require vendorName/packageName "*"
or add
"vendorName/packageName": "*"
to the require
section of your composer.json
file.
Usage
There are two ways how to use assets.
Either register it in view.
\mgcode\assets\AwesomeGridAsset::register($this);
Either add it as dependency to your asset
namespace app\assets; use yii\web\AssetBundle; class MyAsset extends AssetBundle { ... public $depends = [ 'mgcode\assets\AwesomeGridAsset', ]; }
Replace AwesomeGridAsset with desired asset. (See Assets section)
Assets
Awesome Grid
Asset:
mgcode\assets\AwesomeGridAsset
Dependencies:
"bower-asset/awesome-grid": "*"
BxSlider
Assets:
mgcode\assets\BxSliderAsset
mgcode\assets\BxSliderPluginAsset
Dependencies:
"bower-asset/bxslider-4": "*"
History.js
Asset:
mgcode\assets\HistoryJsAsset
Dependencies:
"bower-asset/history.js": "*"
Intl.js
Main asset:
mgcode\assets\IntlJsAsset
Locale Asset:
mgcode\assets\IntlJsLocaleAsset
By default IntlJsLocaleAsset
uses locale defined in Formatter configuration.
If you want to override it you can define it in application params
section:
return [ ..... application configuration .... 'params' => [ 'intlJsLocale' => 'en-US', ... ] ];
Dependencies:
"bower-asset/intl": "*"
Ionicons
Asset:
mgcode\assets\IoniconsAsset
Dependencies:
"bower-asset/ionicons": "*"
jQuery.browser
Asset:
mgcode\assets\JqueryBrowserAsset
Dependencies:
"bower-asset/jquery.browser": "*"
jQuery Serialize Object
Asset:
mgcode\assets\JquerySerializeObjectAsset
Dependencies:
"bower-asset/jquery-serialize-object": "~2"
JavaScript Cookie
Asset:
mgcode\assets\JsCookieAsset
Dependencies:
"bower-asset/js-cookie": "~2"
Sly
Asset:
mgcode\assets\SlyAsset
Dependencies:
"bower-asset/sly": "*"
Sticky
Asset:
mgcode\assets\StickyAsset
Dependencies:
"bower-asset/sticky": "*"
Owl Carousel
Asset for JS && CSS files:
mgcode\assets\OwlCarouselAsset
Asset for JS file:
mgcode\assets\OwlCarouselScriptAsset
Dependencies:
"bower-asset/owl.carousel": "*"
Owl Carousel 2 Thumbnails
Asset for JS && CSS files:
mgcode\assets\OwlCarouselThumbsAsset
Dependencies:
"bower-asset/owl.carousel2.thumbs": "*"
Are You Sure?
Asset:
mgcode\assets\AreYouSureAsset
Dependencies:
"bower-asset/jquery.are-you-sure": "*"
Bootstrap Tabdrop
Asset:
mgcode\assets\BootstrapTabdropAsset
Autobahn JS
0.8.2 is the last version of Autobahn|JS that supports version 1 of WAMP.
Please read documentation here: http://autobahn.ws/js/reference_wampv1.html
Asset:
mgcode\assets\AutobahnJsAsset
Seiyria Bootstrap Slider
Asset:
mgcode\assets\SeiyriaBootstrapSliderAsset
Dependencies:
"bower-asset/seiyria-bootstrap-slider": "9.*"
Highcharts
Asset:
mgcode\assets\HighchartsAsset
Dependencies:
"bower-asset/highcharts-release": "*"
messageformat.js
Asset:
mgcode\assets\MessageFormatAsset
Dependencies:
"bower-asset/messageformat": "*"
Fancybox
Asset:
mgcode\assets\FancyboxAsset
Dependencies:
"bower-asset/fancybox": "*"
Enhanced Events
Adds document scrollEnd event. Asset:
mgcode\assets\EnhancedEventsAsset
ReactJS
Asset:
mgcode\assets\ReactAsset
mgcode\assets\ReactDomAsset
Dependencies:
"bower-asset/react": "*"
Single Page Nav
Version 1.2.1 supported.
Asset:
mgcode\assets\SinglePageNavAsset
jQuery Easing
Asset:
mgcode\assets\JqueryEasingAsset
Dependencies:
"bower-asset/jquery-easing-original": "*"
CoreJs TypeAhead
Asset:
mgcode\assets\CoreJsTypeAheadAsset
Dependencies:
"bower-asset/corejs-typeahead": "*"
jQuery File Upload
Asset:
mgcode\assets\JqueryFileUploadAsset
Dependencies:
"bower-asset/blueimp-file-upload": "*"