How to insert Magezon Ninja Menu into theme using code?

How to insert Magezon Ninja Menu into theme using code?

Use this line for insert into theme code:

{{block class="Magezon\NinjaMenus\Block\Menu" identifier="YOUR_MENU_IDENTIFIER"}}

in php:

 

<?php echo $this->getLayout()

->createBlock('Magezon\NinjaMenus\Block\Menu')

->setIdentifier('test1')

->toHtml();

?>