Skip to content

refactor: migrate config form to Twig template#340

Open
giovanny07 wants to merge 2 commits intopluginsGLPI:mainfrom
giovanny07:feat/migrate-config-form-to-twig
Open

refactor: migrate config form to Twig template#340
giovanny07 wants to merge 2 commits intopluginsGLPI:mainfrom
giovanny07:feat/migrate-config-form-to-twig

Conversation

@giovanny07
Copy link
Copy Markdown

Replaces the raw HTML echo statements in PluginTagConfig::showConfigForm() with a Twig template (templates/forms/config.html.twig) using Bootstrap 5 card layout and fields_macros, consistent with the rest of the plugin's
GLPI 11 forms.

No functional changes — only presentation layer refactor.

Replace raw HTML echo statements in PluginTagConfig::showConfigForm()
with a Twig template using Bootstrap 5 card layout and fields_macros,
consistent with the rest of the plugin's GLPI 11 forms.
<h3 class="card-title">{{ __('Tag Management', 'tag') }}</h3>
</div>

<form method="post" action="{{ form_action }}">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Twig, you don’t need to manually handle the <form> DOM.
You simply need to add the following line at the top of your file:

{% extends "pages/setup/general/base_form.html.twig" %}

This will automatically manage the form structure, including the “Save” button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants