pouzite hodnoty skryteho inputu ako parameter pre n:href
- kiri
- Člen | 11
Ahojte.
Nejak sa trapim, lebo neviem ziskat v latte hodnotu hidden inputu a pouzit ho
ako parameter pre n:href
V presenteri mam nieco taketo:
foreach($workers as $worker){
$form->addGroup('')->setOption('container','fieldset class="row"');
$row = $form->addContainer($cnt);
$row->addHidden('id', 'id' )->setDefaultValue($worker->id);
...
$row->addText('name', 'Meno' )->setDefaultValue($worker->first_name.' '. $worker->last_name)
->setAttribute('readonly');
a v latte chcem vygenerovat pre kazdy riadok formulara odkaz na zmazanie zaznamu a potrebujem ho ziskat z hodnoty toho hidden inputu namiesto parametru $record_id.
{form editworkersForm}
<table>
<tr>
<th>Name</th><th>od:</th><th>do:</th><th>mzda:</th><th>obed:</th>
</tr>
{foreach $form->getComponents(FALSE, 'Nette\Forms\Container') as $container}
{formContainer $container}
<tr>
<td>{input name}</td>
<td>{input time_start}</td>
<td>{input time_end}</td>
<td>{input hourly_price}</td>
<td>{input launch_time}</td>
<td><a n:href="Workers:delete **$record_id**">Odstrániť</a></td>
</tr>
{/formContainer}
{/foreach}
</table>
{/form}
Alebo idem na to zle ?
Uz sa s tym trapim 4 hodiny a neviem sa dopatrat ako na to.
Editoval kiri (4. 10. 2018 20:19)