public function __construct($config = array()) { if (empty($config['url'])) { $config['url'] = '/'; } parent::__construct($config); }
public function test($request) { if (!CMSAuth::getInstance()->isLogined()) { return parent::test($request); } return false; }
public function dispatch() { $granted = \CMSAuth::getInstance()->check(); if ($granted) { parent::dispatch(); } else { } }
public function testBuildUrl() { $route = new HttpRoute(['url' => '/:arg1/:arg2!']); $result = $route->buildUrl(['arg1' => 'hello', 'arg2' => 'world']); $this->assertEquals($result, '/hello/world!'); }