<?php if ($this->characterList) : ?>
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th><?= $this->translate('Character') ?></th>
                <th><?= $this->translate('Guild') ?></th>
                <th><?= $this->translate('Level') ?></th>
            </tr>
            </thead>
            <?php
                $i = 1;
                foreach ($this->characterList as $character) :
                /** @var $character \GameBackend\Entity\Game\CharacterInterface */
             ?>
                <tr>
                    <td><?= $i++; ?></td>
                    <td>
                        <a href="<?= $this->url('PServerRanking/character', ['id' => $character->getId() ]) ?>">
                            <?= $character->getName() ?>
                        </a>
                    </td>
                    <td>
                        <?=
                            $character->getGuild() ?
                                (
                                    '<a href="' . $this->url('PServerRanking/guild', ['id' => $character->getGuild()->getId()]) .'">'
                                    .$character->getGuild()->getName().'</a>'
                                )
                            :
                                ''
                        ?>
                    </td>
                    <td><?= $character->getLevel() ?></td>
                </tr>
            <?php endforeach; ?>
        </table>
    </div>
<?php endif; ?>