나는 documentation on Strategies을 읽었으며 적어도 아래 코드는 Zend Framework 2에서 유효하다고 여겨집니다. 물론 테스트를 마쳤습니다.ZFC Rbac UnauthorizedStrategy and Zend Framework 3
public function onBootstrap(EventInterface $e)
{
$t = $e->getTarget();
$t->getEventManager()->attach(
$t->getServiceManager()->get('ZfcRbac\View\Strategy\UnauthorizedStrategy')
);
}
젠드 프레임 워크 3을 사용하면 더 이상 작동하지 않습니다. 아래에 오류가 표시됩니다.
Fatal error: Uncaught TypeError: Argument 2 passed to Zend\EventManager\EventManager::attach() must be callable, object given, called in /var/www/sub.domain.tld/html/module/Application/src/Module.php on line 20
기본적으로 저는 지금 당장 붙어 있습니다. 적어도 올바른 방향으로 안내하거나 안내 할 수 있습니까?