# responsive-menu/3.0.11/src/app/Form/Checkbox.php

Responsive Menu – Create Mobile-Friendly Menu, version 3.0.11. 23 lines.

- Page: https://pluginprobe.com/plugins/responsive-menu/3.0.11/code/src/app/Form/Checkbox.php
- Raw: https://pluginprobe.com/plugins/responsive-menu/3.0.11/raw/src/app/Form/Checkbox.php
- Modified: 2016-08-27T00:57:36+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.11/code/src/app/Form/Checkbox.php#L10-L20`.

```php
<?php

namespace ResponsiveMenu\Form;
use ResponsiveMenu\Models\Option;
use ResponsiveMenu\Form\FormComponent;

class Checkbox implements FormComponent {

	public function render(Option $option) {
    
    $checked = $option->getValue() == 'on' ? " checked='checked'" : "";

		return "<div class='onoffswitch'>
            <input type='checkbox' class='checkbox onoffswitch-checkbox' id='{$option->getName()}'{$checked} name='menu[{$option->getName()}]' value='on' />
            <label class='onoffswitch-label' for='{$option->getName()}'>
                <span class='onoffswitch-inner'></span>
                <span class='onoffswitch-switch'></span>
            </label>
          </div>";
	}

}

```
