I could get and set $baseUrl like this in every route,
<?php
$app->get('/sign-in', function ($request, $response, $args) {
$uri = $request->getUri();
$baseUrl = $uri->getBaseUrl();
$this->renderer->render($response, 'sign-in.phtml', $args);
});
But I have to set it in every route for all views.
Is there a way where I can set $baseUrl in a place and use it in every routes/views ?