M
M
Michael2017-10-30 17:27:35
JavaScript
Michael, 2017-10-30 17:27:35

How to include multiple files in Assets in yii2?

Project on yii2 and angularjs (not modular). I want to include files in web/js/app/*.js by mask. But in standard yii2 there is no such thing. You can start using webpack but haven't worked with it. And for angularjs there is no simple integration with it.
Is there any easy extension to include multiple files by mask?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vyachin, 2017-10-30
@springimport

namespace app\assets;


use yii\web\AssetBundle;

class AngularAsset extends AssetBundle
{
    public function init()
    {
        parent::init();
        $this->js = array_map('basename', glob(__DIR__.'/../web/js/app/*.js'));
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question