Skip to content

Instantly share code, notes, and snippets.

@phalcon
Last active December 20, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phalcon/6181411 to your computer and use it in GitHub Desktop.
Save phalcon/6181411 to your computer and use it in GitHub Desktop.
<?php
$volt = new Phalcon\Mvc\View\Engine\Volt\Compiler();
file_put_contents('x.php', $volt->compileString('{%- macro error_messages(message, field, type) %}
<div>
<span class="error-type">{{ type }}</span>
<span class="error-field">{{ field }}</span>
<span class="error-message">{{ message }}</span>
</div>
{%- endmacro %}
{{ error_messages("there is an error", "id", "required") }}'));
require 'x.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment