bbcrew/BB — pull request #6 by func0der (2013-03-25 13:15:54+00:00)
Title: Added PaginatorHelper::sort support to BbTableHelper thead columns

As requested in issue #5.
Working as the following:

echo $this->BbTable->render(
$dataFiles,
array(
'columns' => array(
'id' => array(
'label' => __('Id'),
// Options for PaginatorHelper::sort() method (third parameter) - begin
'paginator' => array(
'direction' => 'desc'
)
// Options for PaginatorHelper::sort() method (third parameter) - end
),
'label' => array(
'label' => __('Label'),
// Complete turn of pagination for this column - begin
'paginate' => false,
// Complete turn of pagination for this column - end
),
'size',
// For actions column Paginator::sort() parsing is turned off
'actions' => array(
'label' => __('Actions'),
'items' => array(
'view',
'edit',
'delete' => array(
'confirm' => __('Entry will be deleted?')
)
),
),
),
)
);

The whole Paginator::sort() parsing takes place AFTER! the label was obtained by whatever method. This will not break any existing applications and all other modifications not already implemented can be applied.
$label will be used as second parameter of the Paginator::sort() method.