Exemplo n.º 1
0
 /**
  * Action to redirect short link to normal link
  */
 public function check()
 {
     $short = $this->router->getParam('short');
     $modelLink = new Link();
     $shortRow = $modelLink->getShort($short);
     if ($shortRow) {
         $modelLink->addClick($shortRow['id']);
         Helper::header(301, $shortRow['link']);
         exit;
     }
     Helper::header(404);
 }