Manohar Khadka
Manohar Khadka

Reputation: 2195

Do not use layout for certain functions in cakephp 3

I have defined some specific layout for my project in cakephp 3.But I don't need layout for certain functions.How to make it disable.Thanks in advance !

Upvotes: 1

Views: 3390

Answers (2)

SnguyenOne
SnguyenOne

Reputation: 151

In CakePHP version >= 3.5 it is this function:

$this->viewBuilder()->enableAutoLayout(false);

Upvotes: 7

Disorder
Disorder

Reputation: 430

You can use this in your functions to remove the default layout :

$this->viewBuilder()->layout(false);

Upvotes: 5

Related Questions