You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
engelsystem/src/Routing/RoutingServiceProvider.php

22 lines
575 B
PHP

<?php
namespace Engelsystem\Routing;
use Engelsystem\Container\ServiceProvider;
class RoutingServiceProvider extends ServiceProvider
{
public function register()
{
$config = $this->app->get('config');
$class = UrlGenerator::class;
if (!$config->get('rewrite_urls', true)) {
$class = LegacyUrlGenerator::class;
}
$urlGenerator = $this->app->make($class);
$this->app->instance('routing.urlGenerator', $urlGenerator);
$this->app->bind(UrlGeneratorInterface::class, 'routing.urlGenerator');
}
}