src/Leevel/Router/Provider/Register.php
protected function url(): void
    {
        $this->container->singleton('url', function (IContainer $container) {
            $option = $container['option'];
            $router = $container['router'];

            $options = [];

            foreach ([
                'with_suffix',
                'suffix',
                'domain',
            ] as $item) {
                $options[$item] = $option->get($item);
            }

            return new Url($container['request'], $options);
        });
    }
protected function url(): void
    {
        $this->container->singleton('url', function (IContainer $container) {
            $option = $container['option'];
            $router = $container['router'];

            $options = [];

            foreach ([
                'with_suffix',
                'suffix',
                'domain',
            ] as $item) {
                $options[$item] = $option->get($item);
            }

            return new Url($container['request'], $options);
        });
    }
注册 url 服务