我刚刚从 github 下载了 ZF2 的 ZendFrameworkSkeleton。一切正常,但我收到此错误:
An alias "translator" was requested but no service could be found.
我对ZF2一无所知。有人可以帮忙吗?
这是我得到它的地方:ZF2Skeleton
编辑***
我在以下位置找到了这段代码module/Application/config/module.config.php
:
'service_manager' => array(
'abstract_factories' => array(
'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
'Zend\Log\LoggerAbstractServiceFactory',
),
'aliases' => array(
'translator' => 'MvcTranslator',
),
),
'translator' => array(
'locale' => 'en_US',
'translation_file_patterns' => array(
array(
'type' => 'gettext',
'base_dir' => __DIR__ . '/../language',
'pattern' => '%s.mo',
),
),
),