Recently installed Phalcon 4.0 on a new server and I am refactoring the code to take account of the new changes.
I cannot access the class FilterLocatorFactory(); for some reason.
In the app I have tried use Phalcon\Di; use Phalcon\Filter\FilterLocatorFactory;
$container = new Di();
$container->set(
'filter',
function () {
$someFilter = new FilterLocatorFactory();
return $factory->newInstance();
}
);
But this come back with the error:
PHP Fatal error: Uncaught Error: Class 'Phalcon\\Filter\\FilterLocatorFactory' not found in /var/foo/bar
For maintainability I want to instantiate the filter in the $di then just call it from anywhere using:
$this->filter("mynaastystring","string");
Any advice would be much appreciated. Cannot seem to acces it in on-construct() or inisitalize() either.
Thanks