How to get and check current url in the view twig template?

In the main layout of view, I want to put condition to display separately div content in home and another page.

Here is an example.


public function __invoke(Request $request, Response $response): ResponseInterface
    $viewData = [
        'url' => $request->getUri(),
    return $this->view->render($response, 'Home/home-index.twig', $viewData);

Twig Template

URL: {{ url }}

Update: Slim4: how to get args for is_current_url() in twig