2017-01-14 49 views
0

當我從文檔複製:的Zend - 未定義類TableGateway

use Zend\Db\TableGateway\TableGateway; 

PHP風暴顯示

未定義類TableGateway。

什麼可能是錯的?

我試圖在整個項目「TableGateway」進行搜索,我並沒有發現類名。

我試圖運行命令再次

composer install 

萬一出事了,但它顯示已安裝的一切。該composer.json看起來是這樣的:

{ 
    "name": "zendframework/skeleton-application", 
    "description": "Skeleton Application for Zend Framework zend-mvc applications", 
    "type": "project", 
    "license": "BSD-3-Clause", 
    "keywords": [ 
     "framework", 
     "mvc", 
     "zf" 
    ], 
    "homepage": "http://framework.zend.com/", 
    "minimum-stability": "dev", 
    "prefer-stable": true, 
    "require": { 
     "php": "^5.6 || ^7.0", 
     "zendframework/zend-component-installer": "^1.0 || ^0.3 || ^[email protected]", 
     "zendframework/zend-mvc": "^3.0.1", 
     "zfcampus/zf-development-mode": "^3.0", 
     "webonyx/graphql-php": "^0.8" 
    }, 
    "autoload": { 
     "psr-4": { 
      "Application\\": "module/Application/src/" 
     } 
    }, 
    "autoload-dev": { 
     "psr-4": { 
      "ApplicationTest\\": "module/Application/test/" 
     } 
    }, 
    "extra": [], 
    "scripts": { 
     "cs-check": "phpcs", 
     "cs-fix": "phpcbf", 
     "development-disable": "zf-development-mode disable", 
     "development-enable": "zf-development-mode enable", 
     "development-status": "zf-development-mode status", 
     "post-create-project-cmd": [ 
      "@development-enable" 
     ], 
     "serve": "php -S 0.0.0.0:8080 -t public/ public/index.php", 
     "test": "phpunit" 
    } 
} 

有什麼不對?

回答

1

您需要安裝DB組件,如果你想使用類從它:

composer require zendframework/zend-db 
+0

怪異,它尚未安裝。 –

+0

運行作曲家要求後順便說一句...我沒有需要運行安裝作曲如果我udnerstand好,它安裝了也。 –

+0

該多好啊 - 我已經更新了我的答案,以反映。 –