在我的Module.php
我有一些休闲方法,我想把它们移到一个地方factory class
,这样我就不会弄乱了Module class
:
public function getControllerConfig()
{
return array(
'factories' => array(
'account-index' => function ($controllerManager) {
$serviceManager = $controllerManager->getServiceLocator();
$accountService = $serviceManager->get('account-service');
return new Controller\IndexController($accountService);
}
)
);
}
public function getServiceConfig()
{
return array(
'factories' => array(
'account-service' => function ($serviceManages) {
return new Service\Account;
}
)
);
}
现在我有:
我应该把这个放在哪里factory class
,也许放在一个Factory
文件夹里?
有任何想法吗?