| 123456789101112131415161718192021222324 |
- <?php
- class RouteBase {
- public function route() {
- $task = V::get('_task', '', $_REQUEST);
- if (empty($task)) {
- $this->defaultAction();
- return;
- }
- $methodName = "{$task}Action";
- if (method_exists($this, $methodName)) {
- $this->{$methodName}();
- } else {
- die("Task '{$task}' not exists");
- }
- }
- public function defaultAction() {
- die("default task not implemented");
- }
- }
|