1
開始工作zf3項目與主義但遇到了這個問題。zend框架3和教條認證
這是我廠
public function __invoke(ContainerInterface $container, $requestedName, Array $options = null) {
$authenticationService = $container->get('doctrine.authenticationservice.orm_default');
$entityManager = $container->get('doctrine.entitymanager.orm_default');
return new $requestedName($entityManager, $authenticationService);
}
和控制器
public function __construct(EntityManager $em, $auth)
{
$this->entityManager = $em;
$this->authService = $auth;
}
public function loginAction()
{
//...
}
在配置
'authentication' => [
'orm_default' => [
'object_manager' => 'Doctrine\ORM\EntityManager',
'identity_class' => 'Application\Entity\Users',
'identity_property' => 'username',
'credential_property' => 'password'
],
],
...
,但它給出了錯誤
此行
$authenticationService = $container->get('doctrine.authenticationservice.orm_default');
給我的錯誤
班 '的Zend \會議\集裝箱' 未找到
您是否安裝了'zend-session'模塊? – Wilt
是需要它,現在工作 –