What is the sense of naming invokables like classes?

前端 未结 3 1849
眼角桃花
眼角桃花 2021-02-04 21:44

I\'m going trough ZfcUser to learn more about modules in Zend Framework 2. In the Module.php you can see

\'invokables\' => array(
  \'ZfcUser\\Authentication\         


        
3条回答
  •  难免孤独
    2021-02-04 22:10

    There is no convention about how aliases are named. You should only give your aliases a unique name so you don't get naming conflicts with other modules providing the same service. I use the FQCN in my project as well, because it avoids any conflicts 100% and it is very clear which class you are requesting from the service manager.

    In the end it all comes down to personal taste, but I'd try to confirm yourself mostly to a single naming strategy and not mix up several tastes.

提交回复
热议问题