Skip to content

Instantly share code, notes, and snippets.

@wdog
Created April 5, 2017 09:43
Show Gist options
  • Save wdog/eb82043505ec5f7c80e6db231a1906ad to your computer and use it in GitHub Desktop.
Save wdog/eb82043505ec5f7c80e6db231a1906ad to your computer and use it in GitHub Desktop.
Alternative Nayjest/Grid sorting_control.php
<small style="white-space: nowrap">
<?php if (!$column->isSortedAsc() && !$column->isSortedDesc()): ?>
<a
class="text-success"
title="Sort ascending"
href="<?= $grid->getSorter()->link($column, 'ASC') ?>"
>
<span class="glyphicon glyphicon-sort" aria-hidden="true"></span>
</a>
<?php elseif ($column->isSortedAsc()): ?>
<a title="Sort descending"
class="text-success"
href="<?= $grid->getSorter()->link($column, 'DESC') ?>"
>
<span class="glyphicon glyphicon-sort-by-attributes" aria-hidden="true"></span>
</a>
<?php elseif ($column->isSortedDesc()): ?>
<a
title="Sort ASC" class="text-success"
href="<?= $grid->getSorter()->link($column, 'ASC') ?>"
>
<span class="glyphicon glyphicon-sort-by-attributes-alt" aria-hidden="true"></span>
</a>
<?php endif ?>
</small>
@wdog
Copy link
Author

wdog commented Apr 5, 2017

smaller sorting controls for https://github.com/Nayjest/Grids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment