distantnative / search-for-kirby

Kirby 3 plugin for adding a search index (sqlite or Algolia).
43 stars 3 forks source link

Better docs for field callback functions #33

Closed distantnative closed 3 years ago

distantnative commented 3 years ago
'myNumberField' => function ($model) { 
    return $model->myNumberField()->toFloat();
}

'myVirtualNumberField' => function ($model) { 
    return $model-> myNumberField()->toInt() + 5;
}

'myDate' => function ($model) { 
    return $model-> anyDateField()->toTimestamp();
}

especially pointing out how they can be used for different formats for Algolia

distantnative commented 3 years ago

✅ Will be included in the docs alongside 1.1.0 release this week.