8000 [Form] Be able to render form several times · Issue #11591 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Form] Be able to render form several times #11591
Closed
@lyrixx

Description

@lyrixx

I have a page that looks like:

_______________
Action block
Ignore / Reject / ....
_______________

all data
table > tr > td * N

_______________
Action block
Ignore / Reject / ....
_______________

As you can see, I have the same "action block" on my page.
All buttons are symfony form. and Right now I'm not able to display the same form twice.
I can use "hacky" code like that:

{# this is a hack, this block in not in the main stream #}
{% block actions %}
    <div class="panel panel-default">
        <div class="panel-heading">Actions</div>
        <div class="panel-body">
            {{ form(form_actions)}}
        </div>
    </div>
{% endblock %}

{% set actions = block('actions') %}

{% block body %}
    {{ actions|raw }}
    table 
    {{ actions|raw }}
{% endblock %}

But I don't like it.

May be I should not use SF form to handle that, But I need CSRF protection. And now, the way to handle CSRF check in a controller, is not so easy.

(PS: I see this issue was rejected in the past, but I have a different use case here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0