public static function getInstance($config_path = null, $cache_path = null) { if (is_null(self::$_instance)) { self::$_instance = new self($config_path, $cache_path); } return self::$_instance; }
<?php require_once '../Spyc.php'; require_once '../tmsRouter.php'; $root_path = dirname(__FILE__) . '/demo/'; $router = tmsRouter::getInstance($root_path . 'routing.yml', $root_path . 'routingCache.php'); echo '<a href="' . $router->getRoute('testrout') . '">link</a><hr/>'; echo 'Current route params: <br/><pre>'; print_r($router->findRoute());