The "tool" is properly parsed if it is present in the json.
This commit is contained in:
Linard Schwendener 2019-11-30 01:15:49 +01:00
Родитель 09be169eac
Коммит cc1bfa0623
2 изменённых файлов: 28 добавлений и 0 удалений

21
templates/content/edit.php Normal file → Executable file
Просмотреть файл

@ -51,6 +51,27 @@
<label><?php p($l->t('Servings')); ?></label>
<input type="number" name="recipeYield" value="<?php if(isset($_['recipeYield'])) { echo $_['recipeYield']; } ?>">
</fieldset>
<fieldset>
<label><?php p($l->t('Tools')); ?></label>
<ul>
<template>
<li>
<input type="text" name="tool[]" value="">
<button class="icon-delete"></button>
</li>
</template>
<?php if(isset($_['tool']) && is_array($_['tool'])) { ?>
<?php foreach ($_['tool'] as $i => $tool) { ?>
<li>
<input type="text" name="tool[]" value="<?php echo $tool; ?>">
<button class="icon-delete"></button>
</li>
<?php } ?>
<?php } ?>
<button class="icon-add"></button>
</ul>
</fieldset>
<fieldset>
<label><?php p($l->t('Ingredients')); ?></label>

Просмотреть файл

@ -47,6 +47,13 @@
</header>
<aside>
<ul>
<h3><?php p($l->t('Tools')); ?></h3>
<?php foreach($_['tool'] as $tools) { ?>
<li><?php echo $tools; ?></li>
<?php } ?>
</ul>
<ul>
<h3><?php p($l->t('Ingredients')); ?></h3>