Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Resources/doc/dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ has been submitted successfully!
<body>
{% if content.form %}
{% if app.request.get('send') != 'true' %}
{% set form_view = sulu_form_build(content.form, 'page', resource.id) %}
{# FORM THEME #}
{% form_theme content.form '@SuluForm/themes/basic.html.twig' %}
{{ form(content.form) }}
{% form_theme form_view '@SuluForm/themes/basic.html.twig' %}
{{ form(form_view) }}
{% else %}
{{ view.form.entity.successText|raw }}
{% endif %}
Expand Down
1 change: 0 additions & 1 deletion Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Add the following lines to `config/routes/sulu_admin.yaml`

```yml
sulu_form_api:
type: rest
resource: "@SuluFormBundle/Resources/config/routing_api.yml"
prefix: /admin/api
```
Expand Down
23 changes: 11 additions & 12 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ The `SingleFormSelection` content type has been replaced with the new Sulu 3.0 c

The form is no longer built during content resolution. Instead, use the new `sulu_form_build` Twig function to build the form at render time:

**before:**

```twig
{{ form(content.formProperty) }}
```

**after:**

```twig
{% set form = sulu_form_build(content.formProperty, 'page', page.id) %}
{% if form %}
{{ form(form) }}
```diff
{% if content.form %}
{% if app.request.get('send') != 'true' %}
- {% form_theme content.form '@SuluForm/themes/basic.html.twig' %}
- {{ form(content.form) }}
+ {% set form_view = sulu_form_build(content.form, 'page', resource.id) %}
+ {% form_theme form_view '@SuluForm/themes/basic.html.twig' %}
+ {{ form(form_view) }}
{% else %}
{{ view.form.entity.successText|raw }}
{% endif %}
{% endif %}
```

Expand Down