mattdanger / phalcon-table-sort
Phalcon HTML table sort component
Installs: 19 535
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2024-11-09 19:32:13 UTC
README
Phalcon HTML table sort component
Requirements
- Phalcon v1.4.x
Installing
Install using Composer:
{ "require": { "mattdanger/phalcon-table-sort": "dev-master" } }
You'll also need to add each function to the Volt service:
$di->set('view', function () use ($config) { $view = new View(); // ... $view->registerEngines(array( '.volt' => function ($view, $di) use ($config) { $volt = new VoltEngine($view, $di); $volt->getCompiler()->addFunction('sortLink', function ($resolvedArgs, $expArgs) { return 'TableSort\Sort::sortLink(' . $resolvedArgs . ')'; }); $volt->getCompiler()->addFunction('sortIcon', function ($resolvedArgs, $expArgs) { return 'TableSort\Sort::sortIcon(' . $resolvedArgs . ')'; }); // ... return $volt; }, // ... )); return $view; });
Using Helpers
Here's a list of what's included:
sortLink($key, $default_sort = 'ASC')
Return a formatted URI string with sort order
sortIcon($key, $default = FALSE)
Return a sort icon