Skip to content

Instantly share code, notes, and snippets.

@tbcorr
Created March 7, 2016 16:21
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 tbcorr/5a7ce891ac3e4f4ad556 to your computer and use it in GitHub Desktop.
Save tbcorr/5a7ce891ac3e4f4ad556 to your computer and use it in GitHub Desktop.
// underscore template in a php file that is meant to be included on the page so that it becomes an "inline template"
<script id="template-composite-view" type="text/template">
<h1>I am a Template With Child View</h1>
<h2>Here they are.</h2>
<% if( children.length ) { %>
<% _.each(children, function(child){ %>
<div id="<%= child.cid %>" class="child-view"></div>
<% }); %>
<% } %>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment