simialbi/yii2-animate

animate.css from daneden for usage in yii framework

Installs: 1 605

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 3

Open Issues: 0

Language:JavaScript

Type:yii2-extension

1.0 2018-09-13 16:03 UTC

This package is auto-updated.

Last update: 2024-02-14 18:44:44 UTC


README

This extension integrates daneden's animate.css into yii2 framework.

Resources

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require --prefer-dist simialbi/yii2-animate

or add

"simialbi/yii2-animate": "*"

to the require section of your composer.json

Usage

Register asset bundle

Either register in view (for example: @app/views/layouts/main.php)

<?php
/* @var $this \yii\web\View */
use simialbi\yii2\animatecss\AnimateCssPluginAsset;

AnimateCssPluginAsset::register($this);

or add the following to your assets/AppAsset.php

<?php
class AppAsset extends \yii\web\AssetBundle {
	public $depends = [
		'simialbi\yii2\animatecss\AnimateCssPluginAsset',
	];
}

Example Usage

Via data attributes

In your view use it like this:

<?php
/* @var $this \yii\web\View */

$this->title = 'My Yii Application';
?>
<div class="site-index">
    <div class="jumbotron" data-animation="tada">
		<h1>Congratulations!</h1>
 
		<p class="lead">You have successfully created your Yii-powered application.</p>
		
		<p>
			<a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a>
		</p>
	</div>
</div>

Via java script

In your view use it like this:

<?php
/* @var $this \yii\web\View */

$this->title = 'My Yii Application';
?>
<div class="site-index">
    <div class="jumbotron">
		<h1>Congratulations!</h1>
 
		<p class="lead">You have successfully created your Yii-powered application.</p>
		
		<p>
			<a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a>
		</p>
	</div>
</div>
<?php
	$this->registerJs("jQuery('.jumbotron').animateCss('tada')");
?>

For more information see official animate.css documentation.

License

yii2-animate is released under MIT license. See bundled LICENSE for details.