Example #1
0
 protected function _prepareDomainsTable()
 {
     $table = new Table();
     $table->addClass('table', 'table-striped', 'tablesorter');
     $row = new TableRow();
     $row->setContent([TableHeading::create('Domain'), TableHeading::create('Price'), TableHeading::create('Source'), TableHeading::create('Month'), TableHeading::create('Year'), TableHeading::create('Status')]);
     $thead = new TableHead();
     $thead->setContent($row);
     $tbody = new TableBody();
     foreach ($this->_domains as $item) {
         $month = $item->month;
         $domain = strtolower(trim($item->domain, ''));
         if (is_numeric($item->month)) {
             $dateObj = \DateTime::createFromFormat('!m', (int) ltrim($item->month, 0));
             $month = $dateObj->format('F');
         }
         $whois = Span::create('Check')->addClass('btn', 'btn-success', 'btn-xs');
         $whois->setAttribute('data-sendretrieve', '/domains/whois/' . $domain);
         $domainLink = new Link('http://www.' . $domain, $domain);
         $row = TableRow::create();
         $row->appendContent([TableCell::create($domainLink), TableCell::create(Encoding::toUTF8($item->price)), TableCell::create($this->_filterSource($item->source)), TableCell::create($month), TableCell::create($item->year), TableCell::create($whois)]);
         $tbody->appendContent($row);
     }
     $table->prependContent($thead);
     $table->appendContent($tbody);
     return Div::create([GoogleAdsense::leaderboard(), $table]);
 }