| 1 | <?php |
||
| 15 | final class HomepageRenderEvent extends Event |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * our event name |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | const EVENT_NAME = 'homepage.render'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * added routes |
||
| 26 | * |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | private $addedRoutes = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * add a route to the homepage |
||
| 33 | * |
||
| 34 | * @param string $url relative (to root) url to the service |
||
| 35 | * @param string $schemaUrl relative (to root) url to the schema |
||
| 36 | * |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | public function addRoute($url, $schemaUrl) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * remove possibly leading slash from url |
||
| 49 | * |
||
| 50 | * @param string $url url |
||
| 51 | * |
||
| 52 | * @return string url |
||
| 53 | */ |
||
| 54 | private function normalizeRelativeUrl($url) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * returns the routes |
||
| 64 | * |
||
| 65 | * @return array routes |
||
| 66 | */ |
||
| 67 | public function getRoutes() |
||
| 71 | } |
||
| 72 |