gpt4 book ai didi

php - 将 PHP 5.3 命名空间 (Doctrine2) 与 Zend Framework 类一起使用

转载 作者:行者123 更新时间:2023-12-04 16:51:43 25 4
gpt4 key购买 nike

我遇到的情况是我的学说模型,Post , 在命名空间 Application\Entities 中我想尝试实现 Zend_Acl_Resource_Interface .我得到了错误

Fatal error: Interface 'Application\Entities\Zend_Acl_Resource_Interface' not found in D:\Projects\Websites\php\ZendFram ework\LearningZF\library\Application\Entities\Post.php on line 8


namespace Application\Entities;
use DoctrineExtensions\NestedSet\Node;

/**
* @Entity @Table(name="posts")
*/
class Post implements Node, Zend_Acl_Resource_Interface {

更新

如果我尝试
class Post implements Node, \Zend_Acl_Resource_Interface {

Fatal error: Interface 'Zend_Acl_Resource_Interface' not found in D:\Projects\Websites\php\ZendFramework\LearningZF\library\Application\Entities\Post.php on line 8

最佳答案

您在使用 the ZF 2.0 branch或稳定的,例如1.10?您的自动加载器设置是否使用 ZF 命名方案加载类?

您可以使用 ZF 开发人员用来将 ZF 转换为 using 命名空间的转换工具:

  • http://github.com/ralphschindler/PHPTools
  • http://blog.calevans.com/2010/03/27/zends-new-namespace-converter/
  • 关于php - 将 PHP 5.3 命名空间 (Doctrine2) 与 Zend Framework 类一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3353847/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com