- Enhancement, new admin "cronjob" dashboard on /setup page, closed #871
- Improved `/setup` page, show DB table `charset`/`collation` info - Upgraded "[_Peity_](http://benpickles.github.io/peity)" js lib `v3.2.1` → `v3.3.0`
This commit is contained in:
@@ -805,6 +805,26 @@ class Controller {
|
||||
Monolog::instance()->log();
|
||||
}
|
||||
|
||||
/**
|
||||
* simple counter with "static" store
|
||||
* -> called within tpl render
|
||||
* @return \Closure
|
||||
*/
|
||||
protected function counter() : \Closure {
|
||||
$store = [];
|
||||
|
||||
return function(string $action = 'increment', string $type = 'default', $val = 0) use (&$store){
|
||||
$return = null;
|
||||
switch($action){
|
||||
case 'increment': $store[$type]++; break;
|
||||
case 'add': $store[$type] += (int)$val; break;
|
||||
case 'get': $return = $store[$type] ? : null; break;
|
||||
case 'reset': unset($store[$type]); break;
|
||||
}
|
||||
return $return;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* get controller by class name
|
||||
* -> controller class is searched within all controller directories
|
||||
|
||||
Reference in New Issue
Block a user