What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
In the dependency provider doc, it says > To create a new dependency provider, copy and adapt th
In the dependency provider doc, it says
To create a new dependency provider, copy and adapt the snippet. Just rename the const
FACADE_FOO_BAR
andfooBar()
according to your requirements.
Am i correct to assume that in
return $container->getLocator()->fooBar()->facade();
fooBar() has no meaning other than symbolic and theoretically can be completely random sequence of characters ?
Comments
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
Hey, it has a meaning. It would look for the
FooBarFacade
insideβ¦/Zed/FooBar/Business/FooBarFacade.php
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
so not βrandomβ - but has a system
0 -
Hmm, okay, thanks. Lowercase/uppercase doesn't matter in this, right ? I'm looking at
foobar()->facade()
, while the facade inFooBar/Business/
isFooBarFacade
0 -
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
It should matter (not 100% sure right now).
foobar()->facade()
should imo look forFoobar
module. butfooBar()->facade()
should look forFooBar
module.0 -
Casing matters, but you should get an auto completion from your editor.
If not rundocker/sdk console dev:ide:generate-auto-completion
0 -
The issue is i'm looking at this project, and it has a case where it's lowercase, there['s only one module with that name, but it's FooBar, not fooBar. Going to ask the coder unless there's some special case for why it works
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
return $container->getLocator()->fooBar()->facade();
This will look for FooBar modules Facade.
there can not be a module fooBar - this would be wrong. So
->*getLocator*()->*fooBar*()
looks for the FooBar module.0 -
Oh, i partially misunderstood your initial response then. Thanks a lot. So the upper/lowercase doesn't matter, but the naming itself matters because that's how it looks for the proper Zed module to take the facade from.
And the coders simply followed up on the camelCase for the naming convention0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
I think we still dont understand each other π
upper/lowercase does matter.
β’ Module names (so the folders and namespaces) are not allowed to start with a lower case letter.
β¦ Wrong: src/Pyz/Zed/myModule
β¦ Wrong: src/Pyz/Zed/my-module
β¦ Correct: src/Pyz/Zed/MyModule
β¦ would work as well but is ugly: src/Pyz/Zed/Mymodule
For finding the facade through locator you could then use for:
β’ src/Pyz/Zed/MyModule/Business/MyModuleFacade.php -->->getLocator()->myModule()->facade()
β’ src/Pyz/Zed/Mymodule/Business/MymoduleFacade.php -->->getLocator()->mymodule()->facade()
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random