fixes to prior commit
[openemr.git] / library / ESign / Router.php
blobd5b2c568821285e1cebb022cc022a5b3822bd4d2
1 <?php
3 namespace ESign;
5 /**
6 * Allows routing to the correct controller and method using the
7 * request string
8 *
9 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @package OpenEMR
23 * @author Ken Chapple <ken@mi-squared.com>
24 * @author Medical Information Integration, LLC
25 * @link http://www.open-emr.org
26 **/
28 require_once $GLOBALS['srcdir'].'/ESign/Abstract/Controller.php';
30 class Router
32 public function route()
34 $request = new Request();
35 $moduleParam = $request->getParam( 'module' );
36 $Module = ucfirst( $moduleParam );
37 require_once $GLOBALS['srcdir'].'/ESign/'.$Module.'/Controller.php';
38 $controllerClass = "\\ESign\\".$Module."_Controller";
39 $controller = new $controllerClass( $request );
40 if ( $controller instanceof Abstract_Controller ) {
41 $controller->run();