A quick reference for the different ways to get a value out of a Statamic entry, and what each one actually gives you back.
Accessors
| Method | Returns |
|---|---|
$entry->title$entry['title'] | single evaluated value |
$entry->value('title') | single raw value from origin |
$entry->augmentedValue('title') | single augmented value |
$entry->get('title') | single raw value |
$entry->toArray()$entry->toEvaluatedAugmentedArray() | array of evaluated values |
$entry->values() | collection of raw values from origin |
$entry->toAugmentedArray() | array of augmented values |
$entry->toAugmentedCollection() | collection of augmented values |
$entry->toShallowAugmentedArray() | shallow array of augmented values |
$entry->toShallowAugmentedCollection() | shallow collection of augmented values |
$entry->data() | collection of raw values |
Types
- raw value: The plain source value that is stored in the entry data.
- augmented value: A
Valueobject that holds the raw value and can return an evaluated value. - evaluated value: The parsed final value that is output in a template.