dynamic menu creation from global variables by twig extension