How to use the multiplier for editing
まだ誰も着手していません。
評価
調査の方向性
The issue names no target file or test; start by reviewing the repository documentation and the addMultiplier usage shown in the PHP snippet. Confirm how existing values should populate multiplier containers during editing and document a correct, reproducible example. Done means a newcomer can follow the documented editing workflow without needing clarification.
索引モデルが issue の本文から書いたものです。
説明
Hello
I'm trying to use a multiplier in a data editing form.
According to the records in the database, the appropriate number of Multiplier elements must be displayed.
Unfortunately, I don't know how to properly access the multiplier components.
Can you state the correct use of the multiplier for editing?
$defHeader = json_decode($defVals->header, true);
$multiplier = $form->addMultiplier('multiplier', function (\Nette\Forms\Container $container, \Nette\Forms\Form $form) {
$arrHlavicka = $this->webhookModel->getHlavicka(['stav'=>1])->fetchPairs("nazev", "nazev");
$container->addSelect('hlavicka', 'Hlavička',$arrHlavicka)
->setHtmlAttribute('class', 'form-control')
->setHtmlAttribute("placeholder", 'Vyberte hlavičku')
->setPrompt('Vyberte hlavičku');
$container->addText('hlavickaval', 'Request Header')
->setHtmlAttribute('class', 'form-control')
->setHtmlAttribute("placeholder", 'Hodnota hlavičky');
}, count($defHeader));
$multiplier->addCreateButton('Přidat hlavičku')
->addClass('btn btn-success');
foreach($defHeader as $k => $v){
$hlavicka[] = [ 'hlavicka' => $k, 'hlavickaval' => $v ];
}
foreach ($multiplier as $index => $container) {
$hlavicka = $container->getComponent('hlavicka');
$hlavickaval = $container->getComponent('hlavickaval');
// Nastavení výchozích hodnot
$hlavicka->setDefaultValue($hlavicka[$index]['hlavicka']);
$hlavickaval->setDefaultValue($hlavicka[$index]['hlavickaval']);
// Přidání tlačítka RemoveButton
$container->addRemoveButton('Smazat')
->addClass('btn btn-danger');
}
Thank you
Thomas
- 主要言語
- PHP
- スター
- 29
- フォーク
- 20
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
contributte/forms-multiplier のほかの issue
-
question
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
contributte/forms-multiplier#117 · コメント 12 件 ·
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
contributte/forms-multiplier#113 ·
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
contributte/forms-multiplier#112 · コメント 2 件 ·
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
contributte/forms-multiplier#86 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
contributte/forms-multiplier#81 · コメント 2 件 ·
contributte/forms-multiplier の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
linuxserver/Heimdall#1626 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
Automattic/static-site-importer#3129 ·
メンテナーはふだん 1 日以内に返信
-
Group 2 - Data Storage | Tripal DBX | Chado Group 5 - Search | ElasticSearch | Views Priority - Medium
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100