I try to create lib for editing pictures. I have main js file for including all other js, css and images files. For example, I used:
$.getScript(site_url + '/vendor/first_folder/second_folder/assets/js/script.js');
I read that path for web sets at AppAsset.php, if I will ask change @webroot to @vendor.. at extention configuration I think it will be wrong. I created my MyAsset.php and set there such configurations:
namespace app\vendor\first_folder\second_folder;
use yii\web\AssetBundle;
class EdikEditorAsset extends AssetBundle {
public $sourcePath = '@vendor/first_folder/second_folder/assets/';
public $css = [
'css/main.css'
];
public $js = [
'js/jquery.colorbox-min.js',
'js/main.js'
];
}
But I cannot include others js, css and image files from my extention, because all js,css and images start including from web folder and I don't know how go do above. What can I change for including js, css, images files from vendor folder?
P.S. I tried to change using different paths this part in js, but noone worked, so I think problem not in this:
$.getScript(site_url + '/vendor/first_folder/second_folder/assets/js/script.js);