Lets change the question : I have a news module with an AdminController , this admin controller should not be accessible through front end so I cant add this contoller to news module's invokables config . I should add admincontroller to ZfcAdmin module's invokables and add News\AdminController as a child route of zfcadmin route . My question is how can I do this invokables config thing in News module not in ZfcAdmin module ? I just want to copy news module in application and it does all the things by itself out of the box.
1 Answers
I don't even understand the question. The syntax is always
'controllers' => [
'invokables' => []
]
Everything you add to that is available in the whole application. Furthermore one Module shouldn't ever try to inject it's classes into another Module. Namespaces are there to separate. There's other ways to tie Modules together (Events, etc...).
If this doesn't satisfy you, you may further explain your problem and we may be able to help you.
Update
My answer won't change in core. You still add the AdminController
to the invokables
array of your NewsModule
. All ZfcAdmin
now needs is for you to add the admin route to your configuration (still inside the NewsModule
. The whole point of this modular system is that you don't have to trick around so much to get your stuff working ;)
As far as the route goes, please see this section of ZfcAdmins Documentation. Everything else you need is inside the documentation, too.
TL/DR it all remains inside your NewsModule
. No files, no configuration, nothing leaves your namespace ;)