2
I’m trying to use a class Built-in
of PHP
inside Cakephp but a:
Error: Class 'App Controller Component Datetime' not found
Where it’s being used:
public function listNewBanners($newBannersQuantity)
{
$newBanners = TableRegistry::get('new_banners');
$query = $newBanners->find();
$query->select(['path_banner', 'date_start', 'date_end'])
->where(['date_start <' => new DateTime('today')])
->limit($newBannersQuantity);
return $query;
}
Official documentation link where I saw this class being used: Documentation
Try to put a bar first,
new \DateTime('today')
– rray
@rray Wizard.... submit a reply, whenever you want to use a built-in class I must use this \ ?
– Ricardo
It’s the same problem of Namespace and PDO = Error
– rray