Hi All,
I have a problem rendering a partial from a common view service in my application. Basically I have a multi module application ( 2 Modules ). Modules :
- Frontend
- Admin I have successfully registered a common view service like this in my service.php file :
/**
* Registering a shared view component
*/
$di->set('commonv', function() {
$view = new \Phalcon\Mvc\View();
$view->setViewsDir(APP_DIR.'/common/views/');
$view->setPartialsDir(APP_DIR.'/common/views/partials/');
return $view;
}, true);
The problem I have is when I actually try to display the common view like this :
// show the common footer
$di = $this->di->getDefault();
$commonv = $di->get("commonv");
// then in my view I do the following
$commonv->partial('footer'));
Then I get an error message like this, :
View 'C:\localhost\my-app/app/common/views/C:\localhost\my-app/app/common/views/partials/footer' was not found in the views directory
#0 [internal function]: Phalcon\Mvc\View->_engineRender(Array, 'C:\\localhost\\my...', false, false, false)
#1 C:\localhost\my-app\app\frontend\controllers\LoginController.php(31): Phalcon\Mvc\View->partial('footer')
#2 [internal function]: Psg\my-app\Frontend\Controllers\LoginController->indexAction()
#3 [internal function]: Phalcon\Dispatcher->dispatch()
#4 C:\localhost\my-app\public\index.php(55): Phalcon\Mvc\Application->handle()
I can tell the paths do not look right, any advice on how I can fix it?
Thanks