View render not working MacOS

Hey,

I have a problem with Phalcon on MacOS. I just joined a project and I can not launch it. The project works fine on Windows, but can not run on MacOS.

After debugging, I arrive at this result:

I set as below my View object:

    $di['view'] = function() {
          $eventsManager = new Phalcon\Events\Manager();
          $eventsManager->attach("view", function($event, $view) {
              var_dump($event->getType() . ' | path => ' . $view->getActiveRenderPath());
          });

          $view = new \Phalcon\Mvc\View();
          $view->setViewsDir("/Applications/MAMP/htdocs/testapp/app/views/");

          var_dump('View dir     =>'  . $view->getViewsDir());
          var_dump('Render level => ' . $view->getRenderLevel());

          $view->registerEngines(array(
              '.volt' => function($view, $di) {
                  $volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
                  $volt->setOptions(array(
                      'compiledPath' => '../app/cache/',
                      'stat' => false,
                      'compileAlways' => true
                  ));

                  return $volt;
              }
    ));

    $view->setEventsManager($eventsManager);

    return $view;
    };

When I make a $this->view->render('test', 'baba') I get this result:

    string(59) "View dir     =>/Applications/MAMP/htdocs/testapp/app/views/"
    string(17) "Render level => 5"
    string(23) "beforeRender | path => "
    string(81) "notFoundView | path => /Applications/MAMP/htdocs/testapp/app/views/test/baba.volt"
    string(84) "notFoundView | path => /Applications/MAMP/htdocs/testapp/app/views/layouts/test.volt"
    string(77) "notFoundView | path => /Applications/MAMP/htdocs/testapp/app/views/index.volt"
    string(76) "afterRender | path => /Applications/MAMP/htdocs/testapp/app/views/index.volt"

Which is ok, the view I want is good /app/views/test/baba.volt

However, when I do $this->view->render("", "baba") the result is as follows:

    string(59) "View dir     =>/Applications/MAMP/htdocs/testapp/app/views/"
    string(17) "Render level => 5"
    string(23) "beforeRender | path => "
    string(33) "notFoundView | path => /baba.volt"
    string(80) "notFoundView | path => /Applications/MAMP/htdocs/testapp/app/views/layouts/.volt"
    string(77) "notFoundView | path => /Applications/MAMP/htdocs/testapp/app/views/index.volt"
    string(76) "afterRender | path => /Applications/MAMP/htdocs/testapp/app/views/index.volt"

I would like Phalcon to load the view in /app/views/baba.volt.

My colleagues do not have this problem. In addition, I can not change the project structure.

Thanks a lot for your help. Cordialy,

Johan

Just fire up a GNU/Linux VM/docker/whatever and be spend your time coding instead of fixing funny things on MacOS/Windows. Your production app runs on GNU/Linux anyways, right?

Hint: https://packagecloud.io/phalcon/stable