Sylius: Have you noticed how Sylius generates forms for you?

Created on 5 Nov 2018  路  7Comments  路  Source: Sylius/Sylius

Sylius docs version: 1.3 / latest

Description

At https://github.com/Sylius/Sylius/blob/master/docs/components_and_bundles/bundles/SyliusResourceBundle/forms.rst the first sentence says: "Have you noticed how Sylius generates forms for you? Of course, for many use-cases you may want to create a custom form." which is kind of out of context, because docs does not describe either that nor how Sylius generates forms.

Do not stale Documentation Good First Issue

Most helpful comment

templates: SyliusAdminBundle:Crud is missing in the docs when someone reads SyliusResourceBundle from start to end. The reader comes from routing to forms but SyliusAdminBundle:Crud is not mentioned anywhere.

All 7 comments

I think we should change the first paragraph to say that's the forms are autogenerated by default and you can customise them.

What do you mean with that the forms are autogenerated? Is the doc missing something important?

I created a resource and the routing:

app_foo:
  resource: |
    alias: app.foo
    templates: foo/
  type: sylius.resource

which gave me the standard routes:

  • foo/
  • foo/new
  • foo/{id}/edit
  • foo/{id}
  • ...

When I call foo/new I do not see any form.

I think your templates in foo/ do not render the form. Could you try replacing templates: foo/ with templates: SyliusAdminBundle:Crud (if that's an admin feature)?

templates: SyliusAdminBundle:Crud is missing in the docs when someone reads SyliusResourceBundle from start to end. The reader comes from routing to forms but SyliusAdminBundle:Crud is not mentioned anywhere.

Good point 馃憤 Do you think you can propose some changes to the documentation which we can iterate on? As an author of this issue, I believe you have the best understanding, how it should look like, to make docs more natural and more understandable :)

@Zales0123 is there some docs somewhere which describes how to only override the form? I see I can use the templates part, but I don't want to completely override the 'Crud/create.html.twig' and 'Crud/update.html.twig'. I just want to create a custom form.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikemix picture mikemix  路  3Comments

xleliberty picture xleliberty  路  3Comments

Chrysweel picture Chrysweel  路  3Comments

hmonglee picture hmonglee  路  3Comments

inssein picture inssein  路  3Comments