| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function renderLogin(array $data) |
||
| 11 | { |
||
| 12 | $request = $this->container->get('request_stack')->getCurrentRequest(); |
||
| 13 | |||
| 14 | $template = 'AlpixelUserBundle:admin:page/login.html.twig'; |
||
| 15 | |||
| 16 | $firewallTemplates = $this->container->getParameter('alpixel_user.firewall_templates'); |
||
| 17 | foreach ($firewallTemplates as $templateParam) { |
||
| 18 | $path = str_replace('/'.$request->getLocale(), '', $request->getPathInfo()); |
||
| 19 | if ($templateParam['login_path'] === $path) { |
||
| 20 | $template = $templateParam['login_template']; |
||
| 21 | break; |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | return $this->container->get('templating')->renderResponse($template, array_merge($data, [ |
||
| 26 | 'background_image' => $this->container->getParameter('alpixel_user.default_login_background_image'), |
||
| 27 | 'color' => $this->container->getParameter('alpixel_user.default_login_background_color'), |
||
| 28 | ])); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |