$field->key()
Returns the name of the field
$field->key(): string
Return type
string
Example
<?= $page->title()->key() . ': ' . $page->title()->value() ?>
This will return an output like this:
Title: Project A
Returns the name of the field
$field->key(): string
string
<?= $page->title()->key() . ': ' . $page->title()->value() ?>
This will return an output like this:
Title: Project A