The preferred way to install this extension is through composer.
Either run
$ composer require dynamikaweb/yii2-layout-behavior "*"
or add
"dynamikaweb/yii2-layout-behavior": "*"
to the require
section of your composer.json
file.
edit the SomeController.php
file.
class SomeController extends Controller
{
public function behaviors()
{
return [
[
'class' => 'dynamikaweb\layout\ChangeLayout',
'when' => Yii::$app->user->isGuest,
'layout' => 'login'
],
...
]
}
}
This project is under BSD-3-Clause license.