Yii2 Browser Pop Window Layout

Hello,

I’m having trouble in overriding the default application theme on a browser popup window. The image attached illustrates as to what I’m currently experiencing. I basically want to remove the top banner (the black menu bar) on the popup window, which has already been inherited from the main layout. I know that there is a work around provided for Yii 1 by by calling a separate layout for the particular popup. But this does not work for Yii2.

Appreciate your help on this.

Thank you.

Do exactly what you said.

Prepare separate layout file without the navigation bar and set layout value


$this->layout = ''; // layout name or path to layout file here'

inside the action rendering this popup.

as you are doing the rendering of Pop Windows?

Are you working with Modal windows?

tries RenderAjax,

return $this->renderAjax(‘create’, [

‘model’ => $model,

]);

Thank you helping me.

But Still its not working.

I am using window.open to create popup window.

this is my action

$this->layout = ‘@app/views/layouts/layout2’;

echo $this->render(‘sr_main_add’);

now its load both layouts.