public function executeTwitter() { $json = json_decode(file_get_contents('http://twitter.com/statuses/user_timeline/140289211.json'), true); $this->tweet = csToolkit::parse_tweet($json[0]['text']); $this->time = $json[0]['created_at']; }
<ul class="infobox-list clearfix"> <?php $i = 0; foreach ($results as $result) { ?> <li <?php echo $i % 2 == 0 ? 'class="alt"' : ''; ?> > <h3 class="half-margin"><?php echo link_to($result['title'], '@info_show?id=' . $result['id']); ?> </h3> <p class="half-margin"> <?php echo $result['abstract'] ? $result['abstract'] : csToolkit::truncate($result['description'], 140); ?> </p> <div> <?php echo link_to('More Info', '@info_show?id=' . $result['id'], array('class' => 'button right')); ?> </div> </li> <?php $i++; } ?> </ul> <?php }
protected function getRowForValues($values) { $possibleValues = null; foreach ($values as $col => $value) { $possibleValues = $this->getPossibleValues($col); foreach ($possibleValues as $row => $val) { if($val === $value) return ($row + 1); } } throw new LogicException("Unable to find a row matching any of the following parameters: ".csToolkit::assoc_implode($values, '%key%=%value%')); }