Hi upgraded to Phalcon 3 and I got error in my existing project.
I have registered the partial directory in index.php
like this
$di->set('partials', function() {
$partials = new View();
$partials->setPartialsDir('../apps/common/views/');
return $partials;
});
And header.phtml
is in same directory as defined above.
In my index.phtml
I have following code
$this->partials->partial("header");
but however above code is giving me following error and have no Idea how to solve it.
Fatal error: Uncaught Exception: The argument is not initialized or iterable() in phalcon/mvc/view.zep:694 Stack trace: #0 [internal function]: Phalcon\Mvc\View->_engineRender(Array, '../apps/common/...', false, false) #1 D:\server\www\example.com\frontend\apps\modules\property\views\index.phtml(2): Phalcon\Mvc\View->partial('header') #2 [internal function]: unknown() #3 [internal function]: Phalcon\Mvc\View\Engine\Php->render('../apps/modules...', Array, true) #4 [internal function]: Phalcon\Mvc\View->_engineRender(Array, 'index', true, true, NULL) #5 [internal function]: Phalcon\Mvc\View->render('index', 'index', Array) #6 D:\server\www\example.com\frontend\public\index.php(485): Phalcon\Mvc\Application->handle() #7 D:\server\www\example.com\frontend\public\index.php(497): RealEstate\MyApplication->main() #8 {main} thrown in phalcon/mvc/view.zep on line 694
What is this error? how it occurred?