示例#1
0
文件: Group.php 项目: Trivivium/Hydro
 /**
  * {@inheritdoc}
  */
 public function group(string $identifier, \Closure $callback)
 {
     parent::group($this->prefix($identifier), $callback);
 }
示例#2
0
<?php

use hydro\routing\storage\Collection;
use hydro\routing\generation\Architect;
use hydro\routing\generation\Interpolator;
$architect = new Architect(new Collection(), new Interpolator());
$architect->group('index', function (Architect $architect) {
    $architect->add('homepage', '/', ['GET' => controllers\index\HomeController::class]);
    $architect->add('about', '/about', ['GET' => controllers\index\AboutController::class]);
});
$architect->group('users', function (Architect $architect) {
    $architect->add('search', '/users/search/{criteria:char}?', ['GET' => controllers\users\UserSearchController::class]);
});
return $architect->finalize();