Then in any controller you want the layout of the module add:
namespace app\modules\myModule\controllers;
use yii\web\Controller;
class SomeController extends Controller
{
## public $layout='/appLayout'; // use layout from app view folder
public $layout='moduleLayout'; // use layout from module view folder
public function actionSomeAction()
{
return $this->render('something');
}
}
If you want to use the layout for the whole module you could create a "BaseController" like:
namespace app\modules\myModule\controllers;
use yii\web\Controller;
class BaseController extends Controller
{
public $layout='moduleLayout';
}
And change every other controller to inherit from BaseController:
namespace app\modules\myModule\controllers;
use yii\web\Controller;
class SomeOtherController extends BaseController
{
... ... ...
}