Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fixed bug with file extensions in uri (fixed #20)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximebf committed Sep 24, 2013
1 parent 3830578 commit 4fb3432
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion example/app/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
'dsn' => 'sqlite:example.db'
),
'Session',
'Flash'
'Flash',
'Errors' => array(
'catch_errors' => true
)
),

'atomik.debug' => true,
'app.layout' => '_layout'

));
8 changes: 6 additions & 2 deletions src/Atomik.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,14 @@ public static function route($uri, $params = array(), $routes = null)
}

if (!$found) {
$format = self::get('app.views.default_context', 'html');
if ($uriExtension !== false) {
$uri = substr($uri, 0, -strlen($uriExtension) - 1);
$format = $uriExtension;
}
$request = array(
'action' => $uri,
self::get('app.views.context_param', 'format') => $uriExtension === false ?
self::get('app.views.default_context', 'html') : $uriExtension
self::get('app.views.context_param', 'format') => $format
);
}

Expand Down

0 comments on commit 4fb3432

Please sign in to comment.