0
A
回答
0
服务类应该是通过ServiceManager
访问。如果类是可用在那里,无论是作为factories
或invokables
,你应该能够从Controller
调用它们像这样:
$this->getServiceLocator()->get('name-of-your-service');
否则,如果它只是你需要使用类,你可以简单地导入和使用他们喜欢
namespace Othermodule;
use My\Module\Class\Name;
class OtherModuleClass {
public function someAction()
{
new Name();
// Or fully qualified inline
new \Third\Module\Class\Name();
}
}
谢谢你的回复。它的工作......谢谢.. – 2013-02-14 09:41:53