[6.x]: Control Panel settings form doesn't offer field toggle option

Cerrado
#19,805 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
php
Área
backend

Línea de trabajo

Start by reading the Craft 6 backend Form API and the Inertia CP Form page mentioned in the issue, then compare their field and grouping options with the previous Twig form example. Done means determining whether the API can express a lightswitch that toggles a settings group, and what change would provide that behavior if it cannot.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug repo:cms
What happened?
Description

A Control Panel settings form built using Craft 6's backend Form API (CraftCms\Cms\Form\Form) and rendered through the Inertia CP Form page.

Previously:

{{ forms.lightswitchField({
    label: "Enable Something",
    name: 'enableSomething',
    on: settings.enableSomething,
    toggle: '#custom-something-settings',
}) }}
<div id="custom-something-settings" class="{{ not settings.enableSomething ? 'hidden' }}">
    {{ forms.textField({
        label: "Additional Setting",
        name: 'additionalSetting',
        value: settings.additionalSetting,
    }) }}
</div>

Currently, I don't think there is an equivalent like:

Field::make('Enable Something', Lightswitch::make('settings.enableSomething')
    ->toggle('custom-something-settings')),

Group::make('custom-something-settings', [
    Field::make('Additional Setting', Text::make('settings.additionalSetting')),
]),
Craft CMS version

6.0.0-alpha.19

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions
Lenguaje dominante
PHP
Estrellas
3.6k
Forks
712
Merge medio
13 h 5 min
PR fusionados (30 d)
328

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de craftcms/cms

Todos los issues de craftcms/cms

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.