Esempio n. 1
0
 public function __invoke(League $tournament, LeaguePeriod $period)
 {
     $html = '<ul class="pager">';
     $html .= '<li class="previous ' . ($period->hasPrevious() ? '' : 'disabled') . '">';
     $html .= '<a href="' . ($period->hasPrevious() ? $this->getUrl($tournament, $period->getPrevious()) : '#') . '">&larr; Older</a>';
     $html .= '</li>';
     $html .= '<li class="next ' . ($period->inCurrentMonth() ? 'disabled' : '') . '">';
     $html .= '<a href="' . ($period->inCurrentMonth() ? '#' : $this->getUrl($tournament, $period->getNext())) . '">Newer &rarr;</a>';
     $html .= '</li>';
     $html .= '</ul>';
     return $html;
 }
Esempio n. 2
0
 public function testNoPreviousInStartMonth()
 {
     $start = new \DateTime('2013-01-01');
     $period = new LeaguePeriod($start, 2013, 01);
     $this->assertFalse($period->hasPrevious());
 }