Razoft
Razoft

Reputation: 1

yii2 How to disable debug module on controller

It is possible to disable debug module in certain controllers?. what I want to do is a controller for ajax, I know that in the controller I can use simple renderPartial or just print the result but what if need to use a widget that registers js assets, that is why I use render but also de debug panels are loaded and need to remove it from the ajax response. If you have another approach of ajax responses please let me know.

Thank you.

Upvotes: 0

Views: 768

Answers (1)

Mihai P.
Mihai P.

Reputation: 9357

Take a look at renderAjax, this might be exactly what you desire: http://www.yiiframework.com/doc-2.0/guide-structure-views.html#rendering-in-controllers

As a side note I never had a problem with any Ajax response because it contains the debugging data from the debug module. Also I have mixed feeling regarding returning a html response already with javascript in it. Are you sure you cannot just register the file from the start?

Upvotes: 0

Related Questions