Contributte\Form-multiplier
- turbo80
- Člen | 50
Zdravim Vas,
potrebuji poradit s Contributte\Form-multiplier mam
tento kod.
pridani hodnot
<?php
$fotografie->addCreateButton(' Přidat obrazek')
->addOnCreateCallback(function (Submitter $submitter) {
$submitter->onClick[] = function (): void {
$this->redrawControl('wrapper');
$this->redrawControl('foto');
};
})
->addClass('ajax');
?>
odstraneni hodnot
<?php
$fotoM->addRemoveButton('Remove')
->addOnCreateCallback(function (SubmitButton $submitter) {
$submitter->onClick[] = function (): void {
$this->redrawControl('wrapper');
$this->redrawControl('foto');
};
})
->addClass('ajax');
?>
vse funguje jak ma, ale potreboval bych pri pridani/odebrani hodnot se
generovalo tlacitko/a jinak u
pridani potrebuji
<button class="btn btn_selected_images">
<span class="images_icon_add"></span>Pridat polozku
</button>
u odebrani
<button class="btn btn_selected_images">
<span class="images_icon_delete"></span>
</button>
vsem moc dekuji za pripadne rady.
Editoval turbo80 (29. 10. 2021 21:32)
- turbo80
- Člen | 50
Martk napsal(a):
Bohužel je to dost ošklivé:
{if $input = $form[multiplier]->getCreateButtons()[1] ?? null} {input $form[multiplier]->getCreateButtons()[1]} {/if}
<div n:if="$input = $_multiplier[Contributte\FormMultiplier\Multiplier::SUBMIT_REMOVE_NAME] ?? null"> {input $input} </div>
Moc dekuji funguje to.
@Martk
Mel bych jeste jednu otazku, mam nastaveno maximalni pocet 5, jde nastavit, kdyz
dosahnu maximalniho poctu, aby se schovalo tlacitko pro pridani? Dekuji
Editoval turbo80 (31. 10. 2021 9:23)