yii2mod / yii2-sweet-alert

SweetAlert widget for Yii2 framework
MIT License
43 stars 18 forks source link

Invalid AlertAsset.php #3

Closed sganz closed 9 years ago

sganz commented 9 years ago

Not sure if something changed, but when installing the component the AlertAsset.php points to files that do not exist, for example the $soucePath is pointing to a '@bower/sweetalert/lib' but the source is actully in '@bower/sweetalert/dist'

Also names are not 'sweet-alert', but 'actually sweetalert'

modified file -

<?php

namespace yii2mod\alert;
use yii\web\AssetBundle;

/**
 * Class AlertAsset
 * @package yii2mod\alert
 */
class AlertAsset extends AssetBundle
{

    /**
     * @var string the directory that contains the source asset files for this asset bundle.
     * A source asset file is a file that is part of your source code repository of your Web application.
     */
    public $sourcePath = '@bower/sweetalert/dist'; /*was lib*/

    /**
     * @var array list of JavaScript files that this bundle contains. Each JavaScript file can be
     * specified in one of the following formats:
     */
    public $js = [
        'sweetalert.min.js', /* was sweet-alert.min.js */
    ];

    /**
     * @var array list of CSS files that this bundle contains. Each CSS file can be specified
     * in one of the three formats as explained in [[js]].
     */
    public $css = [
        'sweetalert.css' /* ws sweet-alert.css */
    ];

}
ihorchepurnyi commented 9 years ago

Thanks for issue, AlertAsset class has been fixed.