Hi. I want to write macros for my notifications settings list. I build easy macros:
{%- macro row(span_text, site_value, email_value, disable_site=false) %}
<tr class="options-row">
<td><span class="infoHS">{{ span_text }}</span></td>
<td><input type="checkbox" {% if site_value %}checked="checked"{% endif %} {% if disable_site %}disabled="disabled"{% endif %} /></td>
<td><input type="checkbox" {% if email_value %}checked="checked"{% endif %} /></td>
</tr>
{%- endmacro %}
And then i call this:
{{ row("Some rus string", 0, 1) }}
{{ row("Some rus string", 1, 1) }}
{{ row("Some rus string", 1, 1, true) }}
disable_site mean, that the site value cannot be overrided by user, for example friends invitation notification.
But when i run this, i give this:
Macro row was called without parameter: disable_site
// Some stacktrase....
Volt generate this template:
<?php function vmacro_row($__p) { if (isset($__p[0])) { $span_text = $__p[0]; } else { if (isset($__p['span_text'])) { $span_text = $__p['span_text']; } else { throw new \Phalcon\Mvc\View\Exception("Macro row was called without parameter: span_text"); } } if (isset($__p[1])) { $site_value = $__p[1]; } else { if (isset($__p['site_value'])) { $site_value = $__p['site_value']; } else { throw new \Phalcon\Mvc\View\Exception("Macro row was called without parameter: site_value"); } } if (isset($__p[2])) { $email_value = $__p[2]; } else { if (isset($__p['email_value'])) { $email_value = $__p['email_value']; } else { throw new \Phalcon\Mvc\View\Exception("Macro row was called without parameter: email_value"); } } if (isset($__p[3])) { $disable_site = $__p[3]; } else { if (isset($__p['disable_site'])) { $disable_site = $__p['disable_site']; } else { throw new \Phalcon\Mvc\View\Exception("Macro row was called without parameter: disable_site"); } } ?>
<tr class="options-row">
<td><span class="infoHS"><?php echo $span_text; ?></span></td>
<td><input type="checkbox" <?php if ($site_value) { ?>checked="checked"<?php } ?> <?php if ($disable_site) { ?>disabled="disabled"<?php } ?> /></td>
<td><input type="checkbox" <?php if ($email_value) { ?>checked="checked"<?php } ?> /></td>
</tr><?php } ?>
And as you can see, disable_site is required! I'm trying with changing value to "false", 0, 12341234, etc, but it don't help me.
Phalcon 1.3.2, Windows