내가지고있어 오류 :ZF 3 개 소개 서비스 및 ServiceManager에
Fatal error: Class Blog\Factory\ListControllerFactory contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Zend\ServiceManager\Factory\FactoryInterface::__invoke) in /d0/home/kgendig/www/Zend/module/Blog/src/Blog/Factory/ListControllerFactory.php on line 28
내가 변경해야 할 무엇 https://framework.zend.com/manual/2.4/en/in-depth-guide/services-and-servicemanager.html
, 내 zend_version() 모든 일을 해요; 2.6.0
<?php
// Filename: /module/Blog/src/Blog/Factory/ListControllerFactory.php
namespace Blog\Factory;
use Blog\Controller\ListController;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class ListControllerFactory implements FactoryInterface
{
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
*
* @return mixed
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$realServiceLocator = $serviceLocator->getServiceLocator();
$postService = $realServiceLocator->get('Blog\Service\PostServiceInterface');
return new ListController($postService);
}
}
'ListControllerFactory.php'를 주면 코드를주지 않으면 아무도 잘못된 것을 말할 수 없습니다. 그렇다면 ZF3에 대해 이야기하고 있지만 ZF2.4 설명서에 대한 링크를 제공하고 2.6 버전이 있어야합니다. ZF2 또는 ZF3와 함께 작동하지만 함께 작동하도록 설계되지 않은 부품은 사용하지 마십시오 ... –
ok 내 첫 번째 메모 – kgendig