Adding model data to a layout - CakePHP4

Hi - I’m fairly new to Cake so expecting that I might be thinking about this in completely the wrong way…

In the site I’m developing I have a single layout for all the pages. This layout includes the main navigation menu bar for the site. Some elements in this navigation bar need to be dynamic ie they’re pulled from information in the database.

I’m not sure what the best way is to get this information into the layout file. I could set it from each of the controller actions but that doesn’t seem right given it’s the same information each time so I’d be duplicating code.

Is there a recognised way of doing this. Should I embed the model actions in the layout file though that seems a bit odd as well given that the layout is doing presentation, not interacting with the models?

Does anyone have any advice on this?

Looks perfect. Many thanks