Main layout rendered twice


Please help me to solve problem with main layout file rendered twice.

I have /views/base.html as Main Layout wich I set using $view->setMainView('base'); Also I have /views/signin/login.html

Base.html is:

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">

<?php echo $this->getContent() ?>


login.html is:


When I use "pick" everything seems to be fine.


But if automatic mode base.html rendered twice. I tried to Google for 3 hours with no success :(

Thank in advance!

Thank you, Izo. I inspected that repo and unfortunately din't find the solution. Maybe I can clarify the situation by telling that I use all 3 view layers in my App: Main Layout, Controller Layout, Action View. This is my initialization code for View in Application.php:

    protected function _registerView()
        $di = $this->getDI();
        $config = $di->get('config');

        $di->set('view', function() use ($di, $config) {
            $view = new \Phalcon\Mvc\View();

            $view->setViewsDir(VIEWS . '/views/');
            $view->setLayoutsDir(VIEWS . '/views/layouts/');

            return $view;
        }, true);

edited Nov '16

here is my view servise

$di->set('view', function () {
    $config = $this->getConfig();

    $view = new View();


        '.volt' => function ($view) {
            $config = $this->getConfig();

            $volt = new VoltEngine($view, $this);

                'compiledPath' => $config->application->cacheDir . 'volt/',
                'compiledSeparator' => '_'

            return $volt;

    return $view;
}, true);

in controllers i do nothing

'viewsDir'       => APP_PATH . '/views/',
'layoutDir'      => APP_PATH . '/layouts/',
'particialDir'   => APP_PATH . '/particials/',