# hurrytimer/2.9.2/includes/Utils/Form.php

HurryTimer – An Scarcity and Urgency Countdown Timer for WordPress &amp; WooCommerce, version 2.9.2. 49 lines.

- Page: https://pluginprobe.com/plugins/hurrytimer/2.9.2/code/includes/Utils/Form.php
- Raw: https://pluginprobe.com/plugins/hurrytimer/2.9.2/raw/includes/Utils/Form.php
- Modified: 2020-10-06T14:09:16+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/hurrytimer/2.9.2/code/includes/Utils/Form.php#L10-L20`.

```php
<?php

namespace Hurrytimer\Utils;

class Form
{

    static function toggle($name, $value, $id, $small = false, $attrs = '')
    {
        ?>
         <input type="hidden"
               name="<?php echo $name ?>"
               value="no" 
          >
              
        <input type="checkbox"
               name="<?php echo $name ?>"
               id="<?php echo $id ?>"
               class="hurryt-input-toggle <?php echo $small ? 'is-small' : '' ?>"
               value="yes" 
               <?php echo $attrs ?>
            <?php 
            echo filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 'checked' :'' ;
            ?>
        />
        <?php
    }

    /**
     * @param $name
     * @param $value
     *
     * @return string
     */
    static function colorInput($name, $value)
    {
        ?>
        <span class="hurrytimer-color-preview"></span>
        <input
                type="text"
                name="<?php echo $name ?>"
                placeholder="Select color"
                autocomplete="off"
                class="hurrytimer-color-input"
                value="<?php echo $value ?>" />
       <span class="dashicons dashicons-no-alt hurrytimer-color-clear"></span>
        <?php
    }
}
```
