PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- public function dispatch($action, $error) {
- $this->error = $error;
- foreach ($this->pre_action as $pre_action) {
- $result = $this->execute($pre_action);
- if ($result) {
- $action = $result;
- break;
- }
- }
- while ($action) {
- $action = $this->execute($action);
- }
- }
- private function execute($action) {
- require_once($action->getFile());
- $class = $action->getClass();
- $controller = new $class($this->registry);
- } else {
- $action = $this->error;
- $this->error = '';
- }
- } else {
- $action = $this->error;
- $this->error = '';
- }
- return $action;
- }
- }