-1

How do I show PHP list in Intel XDK ListView?

<ul class="list widget uib_w_2 d-margins" data-uib="app_framework/listview" data-ver="1">
    <li class="widget uib_w_8" data-uib="app_framework/listitem" data-ver="1"><a href="#uib_page_1" data-transition="fade">List Item</a></li>
</ul>

Here is my PHP:

<?php 
for($i=0;$i<10;$i++)
{
?>
<li>List Item<?php echo $i;?></li>
<?php
}
?>  
Will
  • 24,082
  • 14
  • 97
  • 108
  • I answered the best I could, but I think you need to clarify your question a bit :) It's not clear what you're asking. I added a tag and fixed the title and changed "indel xdl" to Intel XDK. – Will Jul 12 '15 at 08:18

1 Answers1

0

It's really unclear what you're trying to do, but, if you just want to make a simple unordered list in HTML with PHP, you're missing the <ul> and </ul> tags (use <ol> instead for a numbered list):

<ul>
<?php for ($i=0; $i<10; $i++): ?>
    <li>List Item <?php echo $i;?></li>
<?php endfor; ?> 
</ul>

Edit

It was misspelled in your post, but I think maybe you're looking for an "Intel XDK ListView"? If so, this guide seems to explain it pretty well, and here is a sample app using one. The ListView HTML you had pasted wasn't showing up because StackOverflow was interpreting it as HTML. If that code works and displays the single list item, just put the <ul class="..." ...> and </ul> tags outside of the for() block and repeat the inner <li> tag inside the loop adding in your <?php echo $i; ?>.

Will
  • 24,082
  • 14
  • 97
  • 108