Skip to main content
Plugins configure themselves through the admin panel. You add a page under /admin/settings/..., render a form with the core layout, and let Aikeedo’s settings component save the values as options.

The page

src/RequestHandlers/SettingsRequestHandler.php
AbstractAdminViewRequestHandler puts the route under /admin and applies the admin middleware, so non-administrators never reach it.

The template

templates/settings.twig

What each piece does

How values are stored

submit() posts the form to /admin/api/options. Each top-level field name becomes one option key, and the nested values become its JSON payload: Saving merges your fields into the existing option, so you can split settings across several pages without wiping the other page’s values.
Namespace your options with your package name, such as hello, unless you’re extending an existing group like features.

Reading values back

In Twig, every option is available under option:
Checkboxes submit 1 or 0, which is cast to a boolean when injected. An option nobody saved yet resolves to null, so always provide defaults.

Writing values from PHP

Add a navigation item in boot() so administrators can find the page, and set extra.default_url in your manifest so the plugins list links to it:
See Navigation for the available sections.
Extension points that the core lists for administrators follow a URL convention: the key you register the implementation under becomes the settings URL, such as /admin/settings/payments/{key}, /admin/settings/tax-engines/{key}, /admin/settings/cdn/{key} and /admin/settings/vector-databases/{key}. Declare a route at that exact path, and point default_url at it.

Handling secrets

  • Use type="password" with autocomplete="new-password".
  • Never echo a secret into JavaScript or a data attribute.
  • Show connection state, such as “key configured”, rather than the value itself, where you can.

Test and live credentials

A common pattern is one mode select plus two credential sets, with hidden inputs mirroring the selected set into the flat keys your PHP reads:
Your PHP then injects option.hello.api_key and doesn’t care which mode is active.

Multi-page settings

For a larger integration, split the pages and redirect until setup is complete:
Use {% set active_menu = '/admin/plugins' %} on those templates so the sidebar highlights Plugins.

Troubleshooting

The form is missing x-ref="form" or @submit.prevent="submit", or xdata isn’t set to settings.
Options are injected when the handler is constructed. Reload the page. If it still shows stale data, clear the cache.
You saved a top-level key that another page also owns. Keep one top-level key per plugin, and merge rather than replace.