PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.0.11
Responsive Menu – Create Mobile-Friendly Menu v3.0.11
4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 All 90 releases
responsive-menu / src / app / Controllers / Front.php

Front.php in Responsive Menu – Create Mobile-Friendly Menu 3.0.11, at src/app/Controllers/Front.php

39 lines 979 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ResponsiveMenu\Controllers;
4
5 use ResponsiveMenu\Services\OptionService;
6 use ResponsiveMenu\View\View;
7 use ResponsiveMenu\ViewModels\Menu;
8 use ResponsiveMenu\ViewModels\Button;
9
10 class Front {
11
12 public function __construct(OptionService $service, View $view, Menu $menu, Button $button) {
13 $this->service = $service;
14 $this->view = $view;
15 $this->menu = $menu;
16 $this->button = $button;
17 }
18
19 public function index() {
20
21 $options = $this->service->all();
22
23 $this->view->echoOrIncludeScripts($options);
24
25 if($options['shortcode'] == 'off'):
26 $this->view->render('button', ['options' => $options, 'button' => $this->button->getHtml($options)]);
27 return $this->view->render('menu', ['options' => $options, 'menu' => $this->menu->getHtml($options)]);
28 else:
29 return $this->view->addShortcode($options, $this->button, $this->menu);
30 endif;
31
32 }
33
34 public function preview() {
35 return $this->view->render('preview');
36 }
37
38 }
39