Categories
Yii2 how to pass argument to filter?
Is it possible to pass an argument to a filter, and if so, how?
Answer the question
In order to leave comments, you need to log in
Can you be more specific? What kind of filter do you mean? In general, parameters are passed to filters as follows:
public function behaviors() { return [ 'customFilter' => [ 'class' => \some\custom\FilterClassName, 'param1' => $value1, 'param2' => $value2, ... ] ] }
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question