Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://obrazkuj.xx/homepage/thumbnail?name=Mp0e7A.jpg&width=718
- po kliku přesměruje na
- http://obrazkuj.xx/i/thumb/718/Mp0e7A.jpg
- //=============================================
- class HomepagePresenter extends BasePresenter
- {
- public function renderThumbnail($name, $width, $height = null)
- {
- $wallPicture = new \App\Components\Thumb($name, $width, $height);
- $this->sendResponse( $wallPicture );
- }
- ...
- }
- //============================================
- class RouterFactory
- {
- /**
- * @return Nette\Application\IRouter
- */
- public static function createRouter()
- {
- $router = new RouteList;
- $router[] = new Route('i/thumb/<width>[x<height>]/<name>', 'Homepage:thumbnail');
- $router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
- return $router;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement