dev-master
9999999-dev https://github.com/mattdanger/phalcon-table-sortPhalcon HTML table sort component
MIT
The Requires
- php >=5.4.0
by Matt West
php phalcon sort
Wallogit.com
2017 © Pedro Peláez
Phalcon HTML table sort component
Phalcon HTML table sort component, (*1)
Install using Composer:, (*2)
{
"require": {
"mattdanger/phalcon-table-sort": "dev-master"
}
}
You'll also need to add each function to the Volt service:, (*3)
$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;
});
Here's a list of what's included:, (*4)
sortLink($key, $default_sort = 'ASC'), (*5)
Return a formatted URI string with sort order, (*6)
sortIcon($key, $default = FALSE), (*7)
Return a sort icon, (*8)
Phalcon HTML table sort component
MIT
php phalcon sort