<?php
namespace Moto\InputFilter\ClickAction; use Moto; class ScrollToAnchor extends Moto\InputFilter\AbstractInputFilter { public function init() { $this->add([ 'name' => 'anchor', 'required' => true, 'filters' => [ ['name' => 'StripTags'], ['name' => 'StringTrim'], ], 'validators' => [ [ 'name' => 'StringLength', 'options' => [ 'encoding' => 'UTF-8', 'min' => 1, 'max' => 200, ], ], ], ]); $this->add([ 'name' => 'time', 'required' => false, 'filters' => [ ['name' => 'StripTags'], ['name' => 'StringTrim'], ['name' => Moto\Filter\FloatValue::class], [ 'name' => Moto\Filter\DefaultFilter::class, 'options' => [ 'value' => 0.4 ] ], ], 'validators' => [ [ 'name' => 'Between', 'options' => array( 'min' => 0, 'max' => 2, ), ] ], ]); } } 