I'm trying to convert my cakephp plugin from 2.X to 3.
I have a little problem inside my component plugin at this line:
$dStart = new DateTime($now); //$now = date('Y-m-d H:i:s');
return me this error:
Error: Class 'CurrencyConverter\Controller\Component\DateTime' not found
Seems that it search DateTime inside my plugin directory. How can I solve it?
Thanks
Try:
$dStart = new \DateTime($now);
because CakePHP 3.0 using namespaces and if you not add a root namespace it will be looking for class under current namespace.