When setting up the view component we need to declare $view Object like the following:
$di->set('view', function () use ($config) {
$view = new View();
$view->setViewsDir($config->application->viewsDir);
$view->setLayout('common');
......
using setLayout(String name) method to set default layout for app