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.
PHP
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 }}