Cleanup
This commit is contained in:
parent
bc5590a95a
commit
f1ebb04cb4
@ -1,9 +0,0 @@
|
||||
<?php foreach ($attr as $k => $v): ?>
|
||||
<?php if ('placeholder' === $k || 'title' === $k): ?>
|
||||
<?php printf('%s="%s" ', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, $attr_translation_parameters, $translation_domain) : $v)) ?>
|
||||
<?php elseif (true === $v): ?>
|
||||
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
|
||||
<?php elseif (false !== $v): ?>
|
||||
<?php printf('%s="%s" ', $view->escape($k), $view->escape($v)) ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
@ -1,2 +0,0 @@
|
||||
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
|
||||
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?>
|
@ -1,3 +0,0 @@
|
||||
<div>
|
||||
<?php echo $view['form']->widget($form) ?>
|
||||
</div>
|
@ -1,4 +0,0 @@
|
||||
<?php if (!$label) { $label = isset($label_format)
|
||||
? strtr($label_format, ['%name%' => $name, '%id%' => $id])
|
||||
: $view['form']->humanize($name); } ?>
|
||||
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, $label_translation_parameters, $translation_domain) : $label) ?></button>
|
@ -1,5 +0,0 @@
|
||||
<input type="checkbox"
|
||||
<?php echo $view['form']->block($form, 'widget_attributes') ?>
|
||||
<?php if (strlen($value) > 0): ?> value="<?php echo $view->escape($value) ?>"<?php endif ?>
|
||||
<?php if ($checked): ?> checked="checked"<?php endif ?>
|
||||
/>
|
@ -1,8 +0,0 @@
|
||||
<?php if ($disabled): ?>disabled="disabled" <?php endif ?>
|
||||
<?php foreach ($choice_attr as $k => $v): ?>
|
||||
<?php if ($v === true): ?>
|
||||
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
|
||||
<?php elseif ($v !== false): ?>
|
||||
<?php printf('%s="%s" ', $view->escape($k), $view->escape($v)) ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'choice_widget_options') ?>
|
@ -1,5 +0,0 @@
|
||||
<?php if ($expanded): ?>
|
||||
<?php echo $view['form']->block($form, 'choice_widget_expanded') ?>
|
||||
<?php else: ?>
|
||||
<?php echo $view['form']->block($form, 'choice_widget_collapsed') ?>
|
||||
<?php endif ?>
|
@ -1,18 +0,0 @@
|
||||
<select
|
||||
<?php if ($required && null === $placeholder && $placeholder_in_choices === false && $multiple === false && (!isset($attr['size']) || $attr['size'] <= 1)):
|
||||
$required = false;
|
||||
endif; ?>
|
||||
<?php echo $view['form']->block($form, 'widget_attributes', [
|
||||
'required' => $required,
|
||||
]) ?>
|
||||
<?php if ($multiple): ?> multiple="multiple"<?php endif ?>
|
||||
>
|
||||
<?php if (null !== $placeholder): ?><option value=""<?php if ($required && empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo '' != $placeholder ? $view->escape(false !== $translation_domain ? $view['translator']->trans($placeholder, [], $translation_domain) : $placeholder) : '' ?></option><?php endif; ?>
|
||||
<?php if (count($preferred_choices) > 0): ?>
|
||||
<?php echo $view['form']->block($form, 'choice_widget_options', ['choices' => $preferred_choices]) ?>
|
||||
<?php if (count($choices) > 0 && null !== $separator): ?>
|
||||
<option disabled="disabled"><?php echo $view->escape($separator) ?></option>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?php echo $view['form']->block($form, 'choice_widget_options', ['choices' => $choices]) ?>
|
||||
</select>
|
@ -1,6 +0,0 @@
|
||||
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
|
||||
<?php foreach ($form as $child): ?>
|
||||
<?php echo $view['form']->widget($child) ?>
|
||||
<?php echo $view['form']->label($child, null, ['translation_domain' => $choice_translation_domain]) ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
@ -1,13 +0,0 @@
|
||||
<?php use Symfony\Component\Form\ChoiceList\View\ChoiceGroupView;
|
||||
|
||||
$translatorHelper = $view['translator']; // outside of the loop for performance reasons! ?>
|
||||
<?php $formHelper = $view['form']; ?>
|
||||
<?php foreach ($choices as $group_label => $choice): ?>
|
||||
<?php if (is_array($choice) || $choice instanceof ChoiceGroupView): ?>
|
||||
<optgroup label="<?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($group_label, [], $choice_translation_domain) : $group_label) ?>">
|
||||
<?php echo $formHelper->block($form, 'choice_widget_options', ['choices' => $choice]) ?>
|
||||
</optgroup>
|
||||
<?php else: ?>
|
||||
<option value="<?php echo $view->escape($choice->value) ?>" <?php echo $formHelper->block($form, 'choice_attributes', ['choice_attr' => $choice->attr]) ?><?php if ($is_selected($choice->value, $value)): ?> selected="selected"<?php endif?>><?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($choice->label, [], $choice_translation_domain) : $choice->label) ?></option>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
@ -1,4 +0,0 @@
|
||||
<?php if (isset($prototype)): ?>
|
||||
<?php $attr['data-prototype'] = $view->escape($view['form']->row($prototype)) ?>
|
||||
<?php endif ?>
|
||||
<?php echo $view['form']->widget($form, ['attr' => $attr]) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'color']);
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'widget_container_attributes') ?>
|
@ -1,11 +0,0 @@
|
||||
<?php if ($widget == 'single_text'): ?>
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple'); ?>
|
||||
<?php else: ?>
|
||||
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
|
||||
<?php echo str_replace(['{{ year }}', '{{ month }}', '{{ day }}'], [
|
||||
$view['form']->widget($form['year']),
|
||||
$view['form']->widget($form['month']),
|
||||
$view['form']->widget($form['day']),
|
||||
], $date_pattern) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
@ -1,7 +0,0 @@
|
||||
<?php if ($widget == 'single_text'): ?>
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple'); ?>
|
||||
<?php else: ?>
|
||||
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
|
||||
<?php echo $view['form']->widget($form['date']).' '.$view['form']->widget($form['time']) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'email']) ?>
|
@ -1,3 +0,0 @@
|
||||
<?php echo $view['form']->start($form) ?>
|
||||
<?php echo $view['form']->widget($form) ?>
|
||||
<?php echo $view['form']->end($form) ?>
|
@ -1 +0,0 @@
|
||||
<?php if ($form->vars['multipart']): ?>enctype="multipart/form-data"<?php endif ?>
|
@ -1,4 +0,0 @@
|
||||
<?php if (!isset($render_rest) || $render_rest): ?>
|
||||
<?php echo $view['form']->rest($form) ?>
|
||||
<?php endif ?>
|
||||
</form>
|
@ -1,7 +0,0 @@
|
||||
<?php if (count($errors) > 0): ?>
|
||||
<ul>
|
||||
<?php foreach ($errors as $error): ?>
|
||||
<li><?php echo $view->escape($error->getMessage()) ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
@ -1,6 +0,0 @@
|
||||
<?php if (!empty($help)): ?>
|
||||
<?php $help_attr['class'] = isset($help_attr['class']) ? trim($help_attr['class'].' help-text') : 'help-text'; ?>
|
||||
<?php $help = false !== $translation_domain ? $view['translator']->trans($help, $help_translation_parameters, $translation_domain) : $help; ?>
|
||||
<?php $help = false === $help_html ? $view->escape($help) : $help ?>
|
||||
<p id="<?php echo $view->escape($id); ?>_help" <?php echo ' '.$view['form']->block($form, 'attributes', ['attr' => $help_attr]); ?>><?php echo $help; ?></p>
|
||||
<?php endif; ?>
|
@ -1,8 +0,0 @@
|
||||
<?php if (false !== $label): ?>
|
||||
<?php if ($required) { $label_attr['class'] = trim((isset($label_attr['class']) ? $label_attr['class'] : '').' required'); } ?>
|
||||
<?php if (!$compound) { $label_attr['for'] = $id; } ?>
|
||||
<?php if (!$label) { $label = isset($label_format)
|
||||
? strtr($label_format, ['%name%' => $name, '%id%' => $id])
|
||||
: $view['form']->humanize($name); } ?>
|
||||
<label<?php if ($label_attr) { echo ' '.$view['form']->block($form, 'attributes', ['attr' => $label_attr]); } ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, $label_translation_parameters, $translation_domain) : $label) ?></label>
|
||||
<?php endif ?>
|
@ -1,5 +0,0 @@
|
||||
<?php foreach ($form as $child): ?>
|
||||
<?php if (!$child->isRendered()): ?>
|
||||
<?php echo $view['form']->row($child) ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
@ -1,7 +0,0 @@
|
||||
<div>
|
||||
<?php $widgetAttr = empty($help) ? [] : ['attr' => ['aria-describedby' => $id.'_help']]; ?>
|
||||
<?php echo $view['form']->label($form); ?>
|
||||
<?php echo $view['form']->errors($form); ?>
|
||||
<?php echo $view['form']->widget($form, $widgetAttr); ?>
|
||||
<?php echo $view['form']->help($form); ?>
|
||||
</div>
|
@ -1,5 +0,0 @@
|
||||
<?php foreach ($form as $child) : ?>
|
||||
<?php if (!$child->isRendered()): ?>
|
||||
<?php echo $view['form']->row($child) ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
@ -1,6 +0,0 @@
|
||||
<?php $method = strtoupper($method) ?>
|
||||
<?php $form_method = $method === 'GET' || $method === 'POST' ? $method : 'POST' ?>
|
||||
<form name="<?php echo $name ?>" method="<?php echo strtolower($form_method) ?>"<?php if ($action !== ''): ?> action="<?php echo $view->escape($action) ?>"<?php endif ?><?php foreach ($attr as $k => $v) { printf(' %s="%s"', $view->escape($k), $view->escape($v)); } ?><?php if ($multipart): ?> enctype="multipart/form-data"<?php endif ?>>
|
||||
<?php if ($form_method !== $method): ?>
|
||||
<input type="hidden" name="_method" value="<?php echo $view->escape($method) ?>" />
|
||||
<?php endif ?>
|
@ -1,5 +0,0 @@
|
||||
<?php if ($compound): ?>
|
||||
<?php echo $view['form']->block($form, 'form_widget_compound')?>
|
||||
<?php else: ?>
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple')?>
|
||||
<?php endif ?>
|
@ -1,7 +0,0 @@
|
||||
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
|
||||
<?php if (!$form->parent && $errors): ?>
|
||||
<?php echo $view['form']->errors($form) ?>
|
||||
<?php endif ?>
|
||||
<?php echo $view['form']->block($form, 'form_rows') ?>
|
||||
<?php echo $view['form']->rest($form) ?>
|
||||
</div>
|
@ -1 +0,0 @@
|
||||
<input type="<?php echo isset($type) ? $view->escape($type) : 'text' ?>" <?php echo $view['form']->block($form, 'widget_attributes') ?><?php if (!empty($value) || is_numeric($value)): ?> value="<?php echo $view->escape($value) ?>"<?php endif ?> />
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->widget($form) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'hidden']) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'number']) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->formEncodeCurrency($money_pattern, $view['form']->block($form, 'form_widget_simple')) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'password']) ?>
|
@ -1,2 +0,0 @@
|
||||
<?php $symbol = false !== $symbol ? ($symbol ? ' '.$symbol : ' %') : '' ?>
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']).$view->escape($symbol) ?>
|
@ -1,5 +0,0 @@
|
||||
<input type="radio"
|
||||
<?php echo $view['form']->block($form, 'widget_attributes') ?>
|
||||
value="<?php echo $view->escape($value) ?>"
|
||||
<?php if ($checked): ?> checked="checked"<?php endif ?>
|
||||
/>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'range']);
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_rows') ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'button_widget', ['type' => isset($type) ? $type : 'reset']) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'search']) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'button_widget', ['type' => isset($type) ? $type : 'submit']) ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'tel']);
|
@ -1 +0,0 @@
|
||||
<textarea <?php echo $view['form']->block($form, 'widget_attributes') ?>><?php echo $view->escape($value) ?></textarea>
|
@ -1,22 +0,0 @@
|
||||
<?php if ($widget == 'single_text'): ?>
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple'); ?>
|
||||
<?php else: ?>
|
||||
<?php $vars = $widget == 'text' ? ['attr' => ['size' => 1]] : [] ?>
|
||||
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
|
||||
<?php
|
||||
// There should be no spaces between the colons and the widgets, that's why
|
||||
// this block is written in a single PHP tag
|
||||
echo $view['form']->widget($form['hour'], $vars);
|
||||
|
||||
if ($with_minutes) {
|
||||
echo ':';
|
||||
echo $view['form']->widget($form['minute'], $vars);
|
||||
}
|
||||
|
||||
if ($with_seconds) {
|
||||
echo ':';
|
||||
echo $view['form']->widget($form['second'], $vars);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif ?>
|
@ -1 +0,0 @@
|
||||
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'url']) ?>
|
@ -1,3 +0,0 @@
|
||||
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
|
||||
<?php if ($required): ?> required="required"<?php endif ?>
|
||||
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?>
|
@ -1,2 +0,0 @@
|
||||
<?php if (!empty($id)): ?>id="<?php echo $view->escape($id) ?>"<?php endif ?>
|
||||
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?>
|
@ -1,6 +0,0 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<?php echo $view['form']->widget($form); ?>
|
||||
</td>
|
||||
</tr>
|
@ -1,11 +0,0 @@
|
||||
<tr>
|
||||
<?php $widgetAttr = empty($help) ? [] : ['attr' => ['aria-describedby' => $id.'_help']]; ?>
|
||||
<td>
|
||||
<?php echo $view['form']->label($form); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $view['form']->errors($form); ?>
|
||||
<?php echo $view['form']->widget($form, $widgetAttr); ?>
|
||||
<?php echo $view['form']->help($form); ?>
|
||||
</td>
|
||||
</tr>
|
@ -1,11 +0,0 @@
|
||||
<table <?php echo $view['form']->block($form, 'widget_container_attributes'); ?>>
|
||||
<?php if (!$form->parent && $errors): ?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php echo $view['form']->errors($form); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php echo $view['form']->block($form, 'form_rows'); ?>
|
||||
<?php echo $view['form']->rest($form); ?>
|
||||
</table>
|
@ -1,5 +0,0 @@
|
||||
<tr style="display: none">
|
||||
<td colspan="2">
|
||||
<?php echo $view['form']->widget($form); ?>
|
||||
</td>
|
||||
</tr>
|
Reference in New Issue
Block a user