snippetByModel() public method
Sets the snippetCallback() to fetchSnippetSourceFromModels(), which allows to fetch the snippet source strings from the Active Record models, using method yii\sphinx\ActiveRecord::getSnippetSource(). For example: class Article extends ActiveRecord
{
public function getSnippetSource()
{
return file_get_contents('/path/to/source/files/' . $this->id . '.txt');;
}
}
$articles = Article::find()->snippetByModel()->all();
Warning: this