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