yii\validators\FilterValidator::init PHP Method

init() public method

public init ( )
    public function init()
    {
        parent::init();
        if ($this->filter === null) {
            throw new InvalidConfigException('The "filter" property must be set.');
        }
    }

Usage Example

 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->filter = function ($value) {
         $value = strip_tags($value, $this->allowedTags);
         return RichTextPurifier::process($value);
     };
     parent::init();
 }
All Usage Examples Of yii\validators\FilterValidator::init