Ok, so I'm borrowing the thread idea from the r/laravel subreddit:
You've got a tiny question about Symfony which you're too embarrassed to make a whole post about, or maybe you've just started a new job and something simple is tripping you up. Share it here in the weekly judgement-free no stupid questions thread.
Oh this is a brilliant idea, but I feel embarassed even on a embarassement-free post. I have so many questions. I’m newbie and currently learning php/oop/web/symfony 5.
Ok let’s start with one : If you develop very different parts in your website (for example, you made a news site and you have a handmade forum), do you use the bundle system from symfony 2/3 (don’t remember when this was central) or now there is a newer way to organize things ?
Thank you !
I’m rebuilding a supervision app.I have controllers that manage only one type of entity with actions associated for them.
For example:
/** @Route(“/product”) */
class ProductController extends AbstractController {
/** @Route(“/”, name=”app_product_list”) */
public function list() {…}
/** @Route(“/{productId<\d+>}”, name=”app_product_view”) */
public function view(Product $product) {…}
/** @Route(“/{productId<\d+>}/print”, name=”app_product_print”) */
public function print(Product $product) {…}
}
Is there a way that inside my “view” template I can create a link to “print” like this:
{{ path(‘app_product_print’) }}
instead of like this:
{{ path(‘app_product_print’, {productId: product.productId}) }}
EDITS: formatting code.
EDIT again : forget to mention version => Symfony 4.4 LTS
What would be a good example of Symfony Service?
I’m studying Symfony, i’m really enjoying it, but i can’t get my head wrapped around a good use case for a service.
Maybe it’s a little bit stupid, but for me it’s not trivial.
Thanks!
GraphQL question. Say you have users entity and you want to access one with id=1 via graphQL. Why does graphQL want the query to look like this:
{
user(id:”/api/users/5″) {
id
}
Can I make it so that I can enter a simple integer ‘5’ in the id parameter?