public function main() { $page = Request::get(0, VAR_URI); if (preg_match('/^(\\d+)-/', $page, $matches) > 0 && !empty($matches[1])) { $airlineData = new CustomData($this->airlinePage->getPosition()); if ($airlineData->load($matches[1])) { $uri = AirlineTools::buildUri($airlineData->getId(), $airlineData->getData('name'), true); $this->flightPage->setBaseUri($uri); $this->breadcrumb->add($airlineData->getData('name'), URI::build($uri)); $flight = Request::get(1, VAR_INT); if (is_id($flight)) { $this->flight($flight); } else { $this->airline($matches[1]); } } else { $this->header(); $this->notFoundError(); $this->footer(); } } else { $this->header(); $this->airlinePage->overview('/Airlines/categories'); $this->footer(); } }