Conditions | 5 |
Paths | 16 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | protected function generateLivePathFor($host, $route = 'piedweb_cms_page', $params = []) |
||
16 | { |
||
17 | if (isset($params['locale'])) { |
||
18 | $params['_locale'] = $params['locale'].'/'; |
||
19 | unset($params['locale']); |
||
20 | } |
||
21 | |||
22 | if ($host instanceof PageInterface) { |
||
23 | $page = $host; |
||
24 | $host = $page->getHost(); |
||
25 | } |
||
26 | |||
27 | if (isset($page)) { |
||
28 | $params['slug'] = $page->getRealSlug(); |
||
29 | } |
||
30 | |||
31 | if ($host) { |
||
32 | $params['host'] = $host; |
||
33 | $route = 'custom_host_'.$route; |
||
34 | } |
||
35 | |||
36 | return $this->router->generate($route, $params); |
||
37 | } |
||
39 |