";
}
// line 3
public function getspanToggle($__input__ = null, $__length__ = null, ...$__varargs__)
{
$context = $this->env->mergeGlobals([
"input" => $__input__,
"length" => $__length__,
"varargs" => $__varargs__,
]);
$blocks = [];
ob_start();
try {
// line 4
echo " ";
$context["space"] = $this->env->getExtension('Grav\Common\Twig\TwigExtension')->repeatFunc(" ", ((($context["length"] ?? null) - twig_length_filter($this->env, ($context["input"] ?? null))) / 2));
// line 5
echo " ";
echo ((($context["space"] ?? null) . ($context["input"] ?? null)) . ($context["space"] ?? null));
echo "
";
} catch (\Exception $e) {
ob_end_clean();
throw $e;
} catch (\Throwable $e) {
ob_end_clean();
throw $e;
}
return ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
}
public function getTemplateName()
{
return "forms/fields/toggle/toggle.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 236 => 5, 233 => 4, 220 => 3, 215 => 65, 205 => 63, 202 => 62, 195 => 61, 190 => 60, 187 => 59, 183 => 57, 180 => 56, 177 => 55, 173 => 53, 171 => 52, 168 => 51, 165 => 50, 162 => 49, 157 => 48, 151 => 46, 149 => 45, 145 => 44, 141 => 43, 137 => 42, 133 => 40, 130 => 39, 127 => 38, 123 => 37, 120 => 36, 114 => 35, 111 => 34, 108 => 33, 103 => 32, 101 => 31, 93 => 30, 89 => 28, 86 => 27, 83 => 26, 81 => 25, 78 => 24, 75 => 23, 72 => 22, 66 => 19, 61 => 18, 58 => 17, 53 => 1, 46 => 13, 44 => 12, 40 => 11, 38 => 10, 36 => 8, 30 => 1,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Source("{% extends \"forms/field.html.twig\" %}
{% macro spanToggle(input, length) %}
{% set space = repeat(' ', (length - input|length) / 2) %}
{{ (space ~ input ~ space)|raw }}
{% endmacro %}
{% import _self as macro %}
{% set has_hidden = false %}
{% for key, text in field.options %}
{% if key is empty %}
{% set has_hidden = true %}
{% endif %}
{% endfor %}
{% block global_attributes %}
{{ parent() }}
data-grav-field-name=\"{{ (scope ~ field.name)|fieldName }}\"
{% endblock %}
{% block input %}
{% set value = (value is same as(false) ? 0 : value) %}
{% if field.force_bool and get_type(value) == 'string'%}
{% set value = true %}
{% endif %}
{% set maxLen = 0 %}
{% for text in field.options %}
{% set translation = text|t|trim %}
{% set maxLen = max(translation|length, maxLen) %}
{% endfor %}
{% for key, text in field.options %}
{% set id = \"toggle_\" ~ field.name ~ key %}
{% set translation = text|t|trim %}
{% endfor %}