FieldMethods
Field methods can be registered for \Kirby\Content\Field objects (which this trait is used for). The field methods can then be used to transform or convert the field value. This enables our daisy-chaining API for templates and other components
-
$fieldMethods->bool()
-
$fieldMethods->callback()
-
$fieldMethods->esc()
-
$fieldMethods->escape()
-
$fieldMethods->excerpt()
-
$fieldMethods->float()
-
$fieldMethods->getMethod()
-
$fieldMethods->h()
-
$fieldMethods->hasMethod()
-
$fieldMethods->html()
-
$fieldMethods->inline()
-
$fieldMethods->int()
-
$fieldMethods->isEmpty()
-
$fieldMethods->isFalse()
-
$fieldMethods->isNotEmpty()
-
$fieldMethods->isTrue()
-
$fieldMethods->isValid()
-
$fieldMethods->kirbytags()
-
$fieldMethods->kirbytext()
-
$fieldMethods->kirbytextInline()
-
$fieldMethods->kt()
-
$fieldMethods->kti()
-
$fieldMethods->length()
-
$fieldMethods->link()
-
$fieldMethods->lower()
-
$fieldMethods->markdown()
-
$fieldMethods->md()
-
$fieldMethods->nl2br()
-
$fieldMethods->or()
-
$fieldMethods->permalinksToUrls()
-
$fieldMethods->query()
-
$fieldMethods->replace()
-
$fieldMethods->short()
-
$fieldMethods->slug()
-
$fieldMethods->smartypants()
-
$fieldMethods->sp()
-
$fieldMethods->split()
-
$fieldMethods->toBlocks()
-
$fieldMethods->toBool()
-
$fieldMethods->toData()
-
$fieldMethods->toDate()
-
$fieldMethods->toEntries()
-
$fieldMethods->toEnum()
-
$fieldMethods->toFile()
-
$fieldMethods->toFiles()
-
$fieldMethods->toFloat()
-
$fieldMethods->toInt()
-
$fieldMethods->toLayouts()
-
$fieldMethods->toLink()
-
$fieldMethods->toObject()
-
$fieldMethods->toPage()
-
$fieldMethods->toPages()
-
$fieldMethods->toQrCode()
-
$fieldMethods->toStructure()
-
$fieldMethods->toTimestamp()
-
$fieldMethods->toUrl()
-
$fieldMethods->toUser()
-
$fieldMethods->toUsers()
-
$fieldMethods->upper()
-
$fieldMethods->v()
-
$fieldMethods->widont()
-
$fieldMethods->words()
-
$fieldMethods->x()
-
$fieldMethods->xml()
-
$fieldMethods->yaml()
Examples
// Page field example with lowercase conversion
$page->myField()->lower();