Cool extension! I thought I'd share how to make this work with mongodb. In the activeDataProvider you need to change two lines in the modifyQuery function. In mongodb the query is the same so you just have to modify the $pattern for the patterns in an array.
protected function modifyQuery(&$query) {
$attribute = $this->alphaAttribute;
$pattern = $this->getPattern();
if ($pattern !== false) {
if (is_array($pattern)) {
$pattern = current($pattern);
}
$query->orFilterWhere(['like', $attribute, new \MongoRegex('/^' . $pattern . '/')]);
}
}
Cool extension! I thought I'd share how to make this work with mongodb. In the activeDataProvider you need to change two lines in the modifyQuery function. In mongodb the query is the same so you just have to modify the $pattern for the patterns in an array.