Skip to content

Commit 00e7601

Browse files
committed
Code cleaing
1 parent 0c1da52 commit 00e7601

File tree

2 files changed

+1
-111
lines changed

2 files changed

+1
-111
lines changed

build.xml

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/Framework.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ public function dispatch()
2525
$query = substr($requestUri, 0, $appendUri === false ? strlen($requestUri) : $appendUri);
2626
$parts = explode('/', preg_replace('~^' . Basepath::get() . '~', '', $query));
2727
$action = count($parts) >= 2 ? array_pop($parts) : 'index';
28-
if (!$action) {
29-
$action = 'index';
30-
}
3128
$controllerName = isset($parts[0]) && $parts[0] ? implode($parts, '\\') : 'index';
3229
$controller = $this->projectNamespace . $this->controllerPackage . '\\' . ucfirst($controllerName);
3330
if (!class_exists($controller)) {
3431
throw new \Exception('controller ' . $controllerName . ' not found');
3532
};
3633
$controller = new $controller;
37-
$action = $action . $this->controllerActionSuffix;
34+
$action = ($action ?: 'index') . $this->controllerActionSuffix;
3835
if (!is_callable(array($controller, $action))) {
3936
throw new \Exception('action ' . $action . ' not found in controller ' . $controllerName);
4037
}

0 commit comments

Comments
 (0)