0

I'm trying to use this tutorial for using Material Ripple in my yii2 advanced app.

And in the Test.html buttons and effects and ripples is working, but in my Yii2 app the library is without any ripple effect.

this is my css's and other files:

enter image description here

Material Asset:

<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace frontend\assets;

use yii\web\AssetBundle;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class MaterialAsset extends AssetBundle
{
    public $sourcePath = '@themes/material';
    public $baseUrl = '@web';
    public $css = [
        'css/material.min.css',
        'css/material-fullpalette.min.css',
        'css/ripples.min.css',
        'css/roboto.min.css',
        'css/site.css'
    ];
    public $js = [
        'js/material.min.js',
        'js/ripples.min.js',
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];
}

How to solve this issue?

T J
  • 42,762
  • 13
  • 83
  • 138
mandev
  • 257
  • 1
  • 5
  • 20
  • 2
    First, you only need `material.min.css` OR `material-fullpalette.min.css`, not both. Second, you aren't showing any of the html generated. Try creating a snippet [with this codepen](http://codepen.io/rosskevin/pen/VvRgrN) to determine your own problem or so we can help further. Third, be sure to download the latest distribution, it's changing quickly! – kross Nov 22 '15 at 20:31

2 Answers2

0

fixed with using this line in view:

$this->registerJs("$.material.init()");

thanks to Yii Irc guys.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
0

If you added all the necessary css and js but it still doesn't work. You might wanna load arrive.js before the material-design.js

Install using bower bower install arrive --save

jofftiquez
  • 7,548
  • 10
  • 67
  • 121