Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fbc's avatar
Level 2

Proper use of Voyager's Menu::display('main')

I'm trying to use the Voyager admin package to output a menu. When you use just:

Menu::display('main')

I get the TEXT. When I use it with curly brackets I get the code. When I use it with @yield I get nothing. So what is the proper use to make it output the menu?

0 likes
2 replies
fbc's avatar
Level 2

I am not sure if it's technically correct, or if there is an easier more accepting way of doing it, but I was able to get it done with :

<? echo Menu::display('main'); ?>
Snapey's avatar
Snapey
Best Answer
Level 122

with blade, double curly braces escape all html entities.

if you know that what you are echoing to the browser is safe, you can remove the protection by using {!!...!!}

   {!! Menu::display('main') !!}
1 like

Please or to participate in this conversation.