我正在尝试将Zend_Date
类用于我的项目。我正在使用 PHP Storm IDE,并且我已经搜索了整个 ZF2 文件夹,该文件夹包含在我的项目中
/vendor/ZF2/library/Zend/ -> now it should be somewhere here but I couldnt've find it in the folder structure...
我还尝试在代码中执行以下操作:
$date = new Zend_Date();
但它打印出以下错误:
Undefined class Zend_Date
我应该在哪里找到Zend_Date
类,如果它不包含在我的文件夹结构中,我在哪里可以获得它?
Zend_Date
是来自Zend Framework 1的一个类。你似乎正在使用Zend Framework 2。不要混合使用 ZF1 和 ZF2 功能。
ZF2 (ZendStdlibDateTime
) 中有一个DateTime
类,但从 ZF 2.1.4 开始已被弃用。请改用 PHP DateTime
类。文档可以在 php.net 上找到。