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

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

- Page: https://pluginprobe.com/plugins/responsive-menu/3.0.6/code/src/app/ViewModels/Components/Admin/Tabs.php
- Raw: https://pluginprobe.com/plugins/responsive-menu/3.0.6/raw/src/app/ViewModels/Components/Admin/Tabs.php
- Modified: 2016-07-22T17:19:42+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/Admin/Tabs.php#L10-L20`.

```php
<?php

namespace ResponsiveMenu\ViewModels\Components\Admin;

class Tabs {

  private $config;

  public function __construct(array $config) {
    $this->config = $config;
  }

  public function render() {
    $i=0;
    foreach(array_keys($this->config) as $tab_name) {
      $active_class = $i == 0 ? ' active_tab' : '';
      echo '<a id="tab_' . $this->i($tab_name) . '" class="tab page-title-action' . $active_class . '">' . $tab_name . '</a>';
      $i++;
    }
  }

  public function i($data) {
      return strtolower(str_replace([' ', '/'], '_', $data));
  }

}

```
