Examples how to use this router needed
I have a project that uses the v2 router. Now, I’ve decided to upgrade it. I tried to figure it out, but I can’t say I fully understand how it should be used.
The docs don’t explain how to create a router instance or register routes at all.
Hi! I am on vacation right now, but I think we could resolve this issue later...
Thanks for the response! Bad timing on my part... Anyway, have a great vacation! ^_^
any updates? :/
@MekDrop Hi!
I’ve put together a small demo, but I suspect you might be looking for something more. Could you tell me how you plan to use the router? Do you want to get the most out of it, or do you have a very specific use case in mind?
Feel free to ask me any questions, describe your scenario, or simply say you need “the full power” — and I’ll prepare a demo tailored to you. If you want the full feature set, the router is almost like a lightweight framework, and the result could look something like this: https://github.com/sunrise-php/awesome-skeleton
Any questions are welcome — I’m happy to help, I just need to understand exactly what you need.
And yes, I agree that the documentation isn’t great right now. There is some documentation here: https://dev.sunrise-studio.io/
…but it’s mostly focused on awesome-skeleton, since that’s how I usually structure my projects. Unfortunately, I can’t write complete documentation for every aspect of the router right this moment — that’s on the roadmap — but I can definitely help you one-on-one and answer any specific questions you have.
@MekDrop https://github.com/fenric/sunrise-router-demo
php -S localhost:8080 public/index.php
curl http://localhost:8080/api/v1/ping
Thanks! I was mostly confused how to register controller paths. I think I get it now.
That package that I plan to update is imponeer/smarty-sunrise-http-router. I hope later reuse for CMS where I'm involved (I still not very good with your v3 but v2 was one of easiest and powerful web routers that I have seen, so that's why)
@MekDrop https://habr.com/ru/articles/891048/
Hey! I once wrote an article for the Russian-speaking community — feel free to use a translator. I think this article is a great example: it shows how to launch a project from scratch using some features of the Sunrise ecosystem. Thanks a lot for your kind words, I really appreciate it!
@MekDrop https://dev.sunrise-studio.io/docs/reference/routing-annotations
In version 3 everything is configured via annotations (attributes). You can check them out here ☝️
@MekDrop https://dev.sunrise-studio.io/docs/reference/router
In the context of your task and your initial question, take a look here ☝️
@MekDrop https://dev.sunrise-studio.io/
You can click through the resource above ☝️, I’m trying to document Sunrise Solutions, but it takes a lot of time. Don’t hesitate to ask questions if something is unclear, and sorry for the response delays!