Created
November 16, 2018 09:15
-
-
Save anoriar/50678d13ccffa9e45a080c98fc69db2d to your computer and use it in GitHub Desktop.
safe get request + mvc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$request = Application::getInstance()->getContext()->getRequest(); | |
try { | |
if (!Loader::includeModule('aero.main')) { | |
throw new Exception('Can\'t include module "Aero".'); | |
} | |
$name = htmlspecialchars($request->getQuery("controller")); | |
$action = htmlspecialchars($request->getQuery("action")); | |
$controller = Mvc::factory($name); | |
$controller->doAction($action); | |
} catch(Exception $e) { | |
print $e->GetMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment