reg2005/oc-range

Widget range for october CMS

1.0.4 2016-07-24 05:09 UTC

This package is not auto-updated.

Last update: 2024-12-27 19:31:13 UTC


README

alt text

How to use:

1. Just add into your plugin or project composer.json:
{
    "require": {
        "reg2005/oc-range": "1.0.*"
    }
}
2. Go to your october project directory use terminal, and run command:

composer update

3. Add to your Plugin.php this:
    public function registerFormWidgets()
    {
        return [
            'reg2005\Widgets\Range\Widget' => [
                'label' => 'range',
                'code'  => 'range'
            ]
        ];
    }

ADD to your fields.yaml something like:

money:
    customLabel: Price
    type: range
    default: 300
    minMax:
      min:
          - 50
      10%:
          - 500
          - 1000
      20%:
          - 1500
          - 2000
      50%:
          - 4000
          - 6000
      60%:
          - 6000
          - 10000
      max:
          - 10000
    span: full

OR:

money:
    customLabel: Price
    type: range
    default: 300
    minMax:
    min: 50
    max: 1000
    span: full