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

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

- Page: https://pluginprobe.com/plugins/responsive-menu/3.0.6/code/src/app/Form/Checkbox.php
- Raw: https://pluginprobe.com/plugins/responsive-menu/3.0.6/raw/src/app/Form/Checkbox.php
- Modified: 2016-06-21T17:18:08+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/Form/Checkbox.php#L10-L20`.

```php
<?php

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

class Checkbox implements FormComponent
{

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

		echo "<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>";
	}

}

```
