Skip to content

Commit

Permalink
Merge pull request #118 from FriendsOfCake/sort-disable
Browse files Browse the repository at this point in the history
Allow disabling column sorting.
  • Loading branch information
ADmad committed Apr 28, 2016
2 parents 3602fc9 + e17745f commit 1b34b2a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Template/Scaffold/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@
<?php
foreach ($fields as $field => $options) :
?>
<th><?= $this->Paginator->sort($field, isset($options['title']) ? $options['title'] : null, $options); ?></th>
<th>
<?php
if (!empty($options['disableSort'])) {
echo isset($options['title']) ? $options['title'] : \Cake\Utility\Inflector::humanize($field);
} else {
echo $this->Paginator->sort($field, isset($options['title']) ? $options['title'] : null, $options);
}
?>
</th>
<?php
endforeach;
endforeach;
?>
<?php if ($actionsExist = !empty($actions['entity'])): ?>
<th><?= __d('crud', 'Actions'); ?></th>
Expand Down

0 comments on commit 1b34b2a

Please sign in to comment.