Validation of settings

edited September 2017 in Modules
In `fuel\config\fuel.php` I have the following:

$config['settings']['footer_column_count'] = array( 'type' => 'number', 'min' => 0, 'max' => 4, 'label' => 'Number of columns in footer', );

It works fine, is displayed in the settings view, and I can only go from 0 up to 4 when using the buttons on the number field, just like the documentation suggests.

However, anyone can enter the number '5', and it would persist into the database just fine.

I was wondering if there's an easy way to add custom validation rules to settings? For example use the `is_between` function in the `Validator Helper` class.

Thanks!

Comments

Sign In or Register to comment.