-->

تشفير الرابط الخاص بك وحماية الرابط من الفيروسات والبرامج الضارة وغيرها! جعل رابطك آمن للزيارة.

How to make core scripts loading such as jQuery in Yii2?



 By using the Yii2 framework, you expect to load the default assets especially the JQuery and Bootstrap javascript files, but it doesn't not.


What is wrong?

If you opened the AppAsset.php file which is present by default in the Yii2 framework, it seems the following


class AppAsset extends AssetBundle


{


public$basePath = '@webroot';


public$baseUrl = '@web';


public$css = [


'css/site.css',


];


public $js = [];


public $depends = [


'yii\web\YiiAsset',


'yii\bootstrap\BootstrapAsset',


];


}

 


By checking the last line in $depends you will find asking the Yii2 framework to load the bootstrap incompletely and we need to replace this line to solve the problem by the following line


'yii\bootstrap\BootstrapPluginAsset',

tp

أحدث التطبيقات