dotblue / nette-webimages

On-the-fly generated web images for your Nette app
Other
26 stars 17 forks source link

Bad route behaviour #8

Closed lookyman closed 9 years ago

lookyman commented 10 years ago

I noticed that when I have this "standard" router factory setup:

/**
 * @return \Nette\Application\IRouter
 */
public function createRouter()
{
    $router = new RouteList();
    $router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
    $router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
    return $router;
}

and in config:

webimages:
    routes:
        - 'images/<id>-<width>x<height>.jpg'

Then the <presenter>/<action>[/<id>] one somehow catches the image request and makes a whole lot of mess. Am I doing something wrong, or is it an issue?

When I actually PREPEND the webimages route, everything works fine. Maybe we should utilize something like https://github.com/Kdyby/Console/blob/master/src/Kdyby/Console/CliRouter.php#L124?

vojtech-dobes commented 9 years ago

Implemented. It's possible to switch it off with prependRoutesToRouter: false if someone wants to plug it in manually in some custom fashion.