-
-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
DocumentationImprovements or additions to documentationImprovements or additions to documentationEnhancement
Description
Feature Request
Clarify documentation for MVC users.
| Q | A |
|---|---|
| New Feature | yes |
| RFC | no |
| BC Break | no |
Summary
I was migrating a Zend Framework 3 application to Laminas and hence from zend-console to laminas-cli.
I read the following page:
https://docs.laminas.dev/laminas-cli/intro/
I find step 3 is confusing:
// config/autoload/dependencies.global.php:
return [
'dependencies' => [
'factories' => [
MyNamespace\Command\MyCommand::class => MyNamespace\Command\MyCommandFactory::class,
],
],
];I spent a good while trying to get this to work and could not, it was only by reading the other stuff further down about ConfigProvider:
namespace MyNamespace;
class Module
{
public function getConfig() : array
{
$configProvider = new ConfigProvider();
return [
'laminas-cli' => $configProvider->getCliConfig(),
'service_manager' => $configProvider->getDependencyConfig(),
];
}
}That I then realized that dependencies should be service_manager for MVC applications and I got the first code working by making it be like:
return [
'service_manager' => [
'factories' => [
MyNamespace\Command\MyCommand::class => MyNamespace\Command\MyCommandFactory::class,
],
],
];Maybe this is obvious to some but I think it would help MVC users to point this out clearly in step 3 as it took me some time to realize why it wasn't working.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DocumentationImprovements or additions to documentationImprovements or additions to documentationEnhancement