For example you have a e-store module with a header which returns the basket you can use the module layout in all the actions
to retrieve the same header. Example e-store controller class:.
php
class EstoreController extends \luya\base\Controller
{
public function actionIndex()
{
return $this->renderLayout('index', ['content' => 'This is my index content in variabel $content.']);
}
public function actionBasket()
{
return $this->renderLayout('basket', ['otherVariable' => 'This is a variable for the basket view file in variable $otherVariable.']);
}
}
The example layout file which is located in
@app/views/module/layout could look something like this:
php