1 | <?php declare(strict_types=1); |
||
24 | class UrlGenerator extends RoutingBase { |
||
25 | |||
26 | /** |
||
27 | * The current HTTP host |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $host; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @param ContainerInterface $container |
||
36 | */ |
||
37 | public function __construct(ContainerInterface $container) |
||
42 | |||
43 | /** |
||
44 | * Get the base url for css/js/images |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public function asset_url() |
||
59 | |||
60 | /** |
||
61 | * Get the base url from the config |
||
62 | * |
||
63 | * @param string $type - (optional) The controller |
||
64 | * @return string |
||
65 | */ |
||
66 | public function base_url($type = "anime") |
||
74 | |||
75 | /** |
||
76 | * Generate a proper url from the path |
||
77 | * |
||
78 | * @param string $path |
||
79 | * @return string |
||
80 | */ |
||
81 | public function url($path) |
||
106 | |||
107 | /** |
||
108 | * Full default path for the list pages |
||
109 | * |
||
110 | * @param string $type |
||
111 | * @throws \InvalidArgumentException |
||
112 | * @return string |
||
113 | */ |
||
114 | public function default_url($type) |
||
126 | |||
127 | /** |
||
128 | * Generate full url path from the route path based on config |
||
129 | * |
||
130 | * @param string $path - (optional) The route path |
||
131 | * @param string $type - (optional) The controller (anime or manga), defaults to anime |
||
132 | * @return string |
||
133 | */ |
||
134 | public function full_url($path = "", $type = "anime") |
||
153 | } |
||
154 | // End of UrlGenerator.php |