Closed bilaljafar closed 7 years ago
My Code class AppAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ 'css/site.css', ]; public $js = [ 'js/site.js', 'js/jquery-pjax.js', ]; public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', 'yii\widgets\PjaxAsset', ]; }
When no Pjax widget is used, then it throws an error "Cannot read property 'push' of undefined"
'js/jquery-pjax.js',
why register the pjax js without the pjax widget? It also looks like you are registering it twice...
My Code class AppAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ 'css/site.css', ]; public $js = [ 'js/site.js', 'js/jquery-pjax.js', ]; public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', 'yii\widgets\PjaxAsset', ]; }
When no Pjax widget is used, then it throws an error "Cannot read property 'push' of undefined"