php7.2 been having some trouble with the dependency injector not available in phalcon 4
The app sets up no problem. I set the view using:
$di = new FactoryDefault();
//otherservices defined here
$di->setShared('view', function() use($di){
$view = new View();
$view->registerEngines(array(".phtml" => function($view) use($di){
$volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
$volt->setOptions(array(
"compiledPath" => "../some/cache/volt/",
));
return $volt;
}));
$view->setViewsDir('../some/dir/');
return $view;
});
When this code is run, everything fires smoothly till we get to:
{{ assets.outputCss('fonts') }}
At which point the server says:
PHP Fatal error: Uncaught Error: Call to a member function outputCss() on
So i tried to see what was going on and basically:
$this->view->assets = $this->assets
Gets the assets loaded.
But then when I get down the page to:
<input type="hidden" id="signup-csrf-token" name="{{ security.getTokenKey() }}" value="{{ security.getToken() }}">
PHP Fatal error: Uncaught Error: Call to a member function getTokenKey()
security is defined in the $di as
$di->set('security', function() use ($di){
$security = new Security();
//Set the password hashing factor to 12 rounds
$security->setWorkFactor(12);
return $security;
}, true);
Been at this for about 3 hours now and cannot find anything in the documentation to help. if you have any ideas at all that would be great. I know phalcon 4 is not quite ready but we are migrating already because we don’t want to be rushing last minute to make all the necessary changes.