public function init()
{
parent::init();
if (Yii::$app->request->isAjax){
$this->layout = '/ajax_page';
}else{
$this->layout = '/blank-panel';
}
public function beforeAction($action)
{
$this->layout = Yii::$app->request->isAjax ? '/ajax_page' : '/blank-panel';
return parent::beforeAction($action);
}