Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // This would probably be done in the controller.
- $movies = array(); // There are a ton of movie objects in this array
- $title = "My page title";
- ?>
- <!-- Template -->
- <h1>
- <?=strtoupper($title)?>
- </h1>
- <div class="movies">
- <p>
- Showing <?=count($movies)?> movie<?=count($movies) != 1?'s':''?>
- </p>
- <?foreach($movies as $idx => $m):?>
- <div class="movie <?=$idx% 2 ? 'odd' : 'event' ?>"/>
- <h2>
- <?=$idx?>)
- <?=strtoupper($m->title)?>
- </h2>
- <h3>Rating<?=count($m->ratings) != 1?'s':''?></h3>
- <p>
- <?= join(' ', $m->ratings)?>
- </p>
- <h3>Link<?=count($m->links) != 1?'s':''?></h3>
- <ul>
- <?if(count($m->links) < 3):?>
- <?=$m->links->unorderedlist()->urlize()?>
- <?else:?>
- <?=$m->links->unorderedlist()->urlizetrunc(12)?>
- <?endif?>
- </ul>
- </div>
- <?endforeach?>
- </div>
Add Comment
Please, Sign In to add comment