In the application, there is a menu that is represented in PHP in the form of an array:
$menu = [
["title" => "Home", "path" => "/home", "children" => []],
["title" => "Secção", "path" => "/seccao", "children" => [
["title" => "Secção 1", "path" => "/seccao/1", "children" => []],
["title" => "Secção 2", "path" => "/seccao/2", "children" => [
["title" => "Subsecção 2.1", "path" => "/seccao/2/1", "children" => [
["title" => "Subsecção 2.1.1", "path" => "/seccao/2/1/1", "children" => [
["title" => "Subsecção 2.1.1.1", "/seccao/2/1/1/1", "children" => []],
["title" => "Subsecção 2.1.1.2", "/seccao/2/1/1/2", "children" => []],
//...
]],
]],
]],
]],
]
The above rendered menu should look like this:
- Home
- Section - Section 1
- Section 2
---- Subsection 2.1
------ Subsection 2.1.1
-------- Subsection 2.1.1.1
-------- Subsection 2.1.1.N
Note that in the example each existing position may have an undefined number of children.
My question is, how to render the menu the way it is in the above example using twig?