Skip to content

Instantly share code, notes, and snippets.

@bogutski
Last active September 6, 2016 05:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bogutski/f8620b5076aec7e04e886196a0b6314c to your computer and use it in GitHub Desktop.
Example. Handlebars template in Volt template in Phalcon
Use this construction
{{ "
... Handlebars here ...
" }}
<script id="saleTemplate" type="text/x-handlebars-template">
<table class="saleTable table table-bordered table-fixed-header" >
<thead>
<th>id</th>
<th>Тип</th>
<th>Ц</th>
<th>КЗ</th>
<th>ДК</th>
<th>П</th>
<th>ЦП</th>
<th>ЗП</th>
<th>ДПП</th>
<th>ПП</th>
<th>ПФ</th>
</thead>
{{ "{{#each items}}" }}
<tr >
<td colspan="100%">
<h4>
{{ "{{ client.client_id }}" }}
<a href="/client/page/{{ "{{ client.client_id }}" }}">{{ "{{ client.client_name }}" }} </a>
{{ "{{ client.client_phone }}" }}
</h4>
</td>
</tr>
{{ "{{#each sales}}" }}
<tr>
<td>{{ "{{ id }}" }} <a href="/sale/edit/{{ "{{ id }}" }}">Edit</a></td>
<td>{{ "{{ saleType }}" }}</td>
<td>{{ "{{ price_base }}" }}</td>
<td>{{ "{{ price_client_paid }}" }}</td>
<td>{{ "{{ price_client_debt }}" }}</td>
<td>{{ "{{ partner_name }}" }}</td>
<td>{{ "{{ price_partner }}" }}</td>
<td>{{ "{{ price_partner_paid }}" }}</td>
<td>{{ "{{ price_partner_debt }}" }}</td>
<td>{{ "{{ price_profit_plan }}" }}</td>
<td>{{ "{{ price_profit_fact }}" }}</td>
</tr>
{{ "{{/each}}" }}
{{ "{{/each}}" }}
</table>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment