3 namespace Wallabag\CoreBundle\Helper
;
5 use Symfony\Component\Routing\Router
;
8 * Manage redirections to avoid redirecting to empty routes.
14 public function __construct(Router
$router)
16 $this->router
= $router;
20 * @param string $url URL to redirect
21 * @param string $fallback Fallback URL if $url is null
25 public function to($url, $fallback = '')
31 if ('' === $fallback) {
32 return $this->router
->generate('homepage');