Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract router from SlimApplicationFactory to RouterFactory #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Extract router from SlimApplicationFactory to RouterFactory #31

wants to merge 1 commit into from

Conversation

Zemistr
Copy link

@Zemistr Zemistr commented May 6, 2019

No description provided.

@Zemistr Zemistr changed the title [WIP] Separate router Separate router May 8, 2019
@Zemistr Zemistr changed the title Separate router Extract router from SlimApplicationFactory to RouterFactory May 8, 2019
removeDefaultHandlers: true # It's recommended to disable original error handling
# and use your own error handlers suited for needs of your app.
services:
- BrandEmbassy\Slim\RouterFactory("%configuration%", ...)::create # Register a router factory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zemistr it would be nice if this service was registered automatically by extension, so there is no extra step needed :-)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... Yeah... probably I can do that... 😉


apiDefinitionKey: api # Your API definition will be under this key in "parameters" section.

slimApi: %configuration% # Configure it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you did there, though i would say previous version without saving configuration to a parameter was more readable for me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understand 😉
Agree, this is maybe a too big change also when it is not totally needed.
I will do some changes today.
Stay tuned 😄

@ghost
Copy link

ghost commented May 8, 2019

The original idea was to separate router as dependency for SlimAppFactory to be able to inject the router into Middleware when needed

Also there is Brand Embassy router based on slim that we use for normal server side rendering and we thought about unifying it and use just one router.

@ghost
Copy link

ghost commented May 8, 2019

@Zemistr
Copy link
Author

Zemistr commented May 8, 2019

Unfortunately, you can't use this router. You have to implement Slim\Interfaces\RouterInterface. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants