# responsive-menu/3.0.6/src/app/ViewModels/Components/Menu/Menu.php

Responsive Menu – Create Mobile-Friendly Menu, version 3.0.6. 36 lines.

- Page: https://pluginprobe.com/plugins/responsive-menu/3.0.6/code/src/app/ViewModels/Components/Menu/Menu.php
- Raw: https://pluginprobe.com/plugins/responsive-menu/3.0.6/raw/src/app/ViewModels/Components/Menu/Menu.php
- Modified: 2016-07-09T12:58:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/responsive-menu/3.0.6/code/src/app/ViewModels/Components/Menu/Menu.php#L10-L20`.

```php
<?php

namespace ResponsiveMenu\ViewModels\Components\Menu;

use ResponsiveMenu\ViewModels\Components\ViewComponent as ViewComponent;
use ResponsiveMenu\Collections\OptionsCollection as OptionsCollection;
use ResponsiveMenu\Walkers\WpWalker as Walker;

class Menu implements ViewComponent {

  public function render(OptionsCollection $options) {

    $menu = apply_filters('wpml_translate_single_string', $options['menu_to_use']->getValue(), 'Responsive Menu', 'menu_to_use');

    /*
    Add Polylang Support */
    if(function_exists('pll__'))
      $menu = pll__($menu);

    return wp_nav_menu(
      [
        'container' => '',
        'menu_id' => 'responsive-menu',
        'menu_class' => null,
        'menu' => $menu && !$options['theme_location_menu']->getValue() ? $menu : null,
        'depth' => $options['menu_depth']->getValue() ? $options['menu_depth']->getValue() : 0,
        'theme_location' => $options['theme_location_menu']->getValue() ? $options['theme_location_menu']->getValue() : null,
        'walker' => $options['custom_walker']->getValue() ? new $options['custom_walker']($options) : new Walker($options),
        'echo' => false
      ]
    );

  }

}

```
