title: PHP Mustache Array Iteration
body: <p>Could you please tell me ways to iterate PHP Mustache array values inside jquery using for loop?</p>
  
  <p>I have tried using below. But it returned all the values inside the array when I swipe. It should return one by one when swipe each time.</p>
  
  <pre><code>$('#b').live('swiperight', function() {
  var template = 
  "{{#users.length}}\
      &lt;ul&gt;\
          {{#users}}\
              &lt;li&gt;{{.}}&lt;/li&gt;\
          {{/users}}\
      &lt;/ul&gt;\
  {{/users.length}}\
  {{^users.length}}\
      &lt;p&gt;No Users&lt;/p&gt;\
  {{/users.length}}";
      var users=new Array();
  var users={ users: ['Tom', 'Jerry'] };
  
  var data = 
  $("#results").append(Mustache.render(template,users ));
      $('#results').toggle();
      $('#b').hide();
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/9V4u3/3/" rel="nofollow">http://jsfiddle.net/9V4u3/3/</a></p>
  
  <p>Thanks in advance.</p>