Skip to content

Instantly share code, notes, and snippets.

@phalcon
Created July 1, 2013 15:22
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/5901789 to your computer and use it in GitHub Desktop.
Save phalcon/5901789 to your computer and use it in GitHub Desktop.
<table>
{% for user in users %}
<tr>
<td> {{ user.id }} </td>
<td> {{ user.username }} </td>
</tr>
{% endfor %}
</table>
$r = new Phalcon\Mvc\View\Engine\Volt\Compiler();
$r->compile('b.volt');
$user1 = new stdClass();
$user1->id = 1;
$user1->username = 'hello-1';
$user2 = new stdClass();
$user2->id = 2;
$user2->username = 'hello-2';
$users = array(
$user1,
$user2
);
require $r->getCompiledTemplatePath();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment