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

クローズ
#19,805 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
PHP
スター
3.6k
フォーク
712
平均マージ
12時間 40分
マージ済み PR(30日)
344

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

craftcms/cms のほかの issue

craftcms/cms の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。