I already tried to override the View class with my own and tried to register jQuery there, but it doesn’t shows up in my html page:
namespace frontend\components;
/**
* This is the base view object, it extends the yii\web\View so you can add custom view stuff here.
*/
class BaseView extends \yii\web\View {
public function init()
{
parent::init();
\yii\web\JqueryAsset::register($this);
}
}
It also works when i put it in my BaseView class (it’s the same class as you should put it in the view). The problem was, i forgot to place the endPage() method in my layout file, now it’s working fine, thanks!
By default the /css/site.css and bootstrap.css are also included, can i disable this?
And how can i let jquery include in the head? instead on the end of the page?
Thanks again! I will let jQuery at the end of my page then. But i still don’t understand how to disable the site.css and bootstrap.css files. If i set the bootstrap part to null in my configuration (assetManager), they still show up.