Guest User

Untitled

a guest
Jan 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2. // This would probably be done in the controller.
  3. $movies = array(); // There are a ton of movie objects in this array
  4. $title = "My page title";
  5. ?>
  6.  
  7. <!-- Template -->
  8.  
  9. <h1>
  10. <?=strtoupper($title)?>
  11. </h1>
  12.  
  13. <div class="movies">
  14. <p>
  15. Showing <?=count($movies)?> movie<?=count($movies) != 1?'s':''?>
  16. </p>
  17.  
  18. <?foreach($movies as $idx => $m):?>
  19. <div class="movie <?=$idx% 2 ? 'odd' : 'event' ?>"/>
  20. <h2>
  21. <?=$idx?>)
  22. <?=strtoupper($m->title)?>
  23. </h2>
  24.  
  25. <h3>Rating<?=count($m->ratings) != 1?'s':''?></h3>
  26. <p>
  27. <?= join(' ', $m->ratings)?>
  28. </p>
  29.  
  30. <h3>Link<?=count($m->links) != 1?'s':''?></h3>
  31. <ul>
  32. <?if(count($m->links) < 3):?>
  33. <?=$m->links->unorderedlist()->urlize()?>
  34. <?else:?>
  35. <?=$m->links->unorderedlist()->urlizetrunc(12)?>
  36. <?endif?>
  37. </ul>
  38. </div>
  39. <?endforeach?>
  40.  
  41. </div>
Add Comment
Please, Sign In to add comment