Advertisement
kazlik

wtf?

Feb 5th, 2017
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. http://obrazkuj.xx/homepage/thumbnail?name=Mp0e7A.jpg&width=718
  2. po kliku přesměruje na
  3. http://obrazkuj.xx/i/thumb/718/Mp0e7A.jpg
  4.  
  5. //=============================================
  6.  
  7. class HomepagePresenter extends BasePresenter
  8. {
  9.     public function renderThumbnail($name, $width, $height = null)
  10.     {
  11.         $wallPicture = new \App\Components\Thumb($name, $width, $height);
  12.         $this->sendResponse( $wallPicture );
  13.     }
  14. ...
  15. }
  16.  
  17. //============================================
  18.  
  19. class RouterFactory
  20. {
  21.  
  22.     /**
  23.      * @return Nette\Application\IRouter
  24.      */
  25.     public static function createRouter()
  26.     {
  27.         $router = new RouteList;
  28.         $router[] = new Route('i/thumb/<width>[x<height>]/<name>', 'Homepage:thumbnail');
  29.         $router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
  30.         return $router;
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement