1

The online documentation states:

Each user has an email address and username by default, and optional fields for a name, photo, and password.

Excuse the dumb question, but where do I find the what the names of those fields are? I feel like I'm missing something.

1 Answer 1

2

If this is from Twig, it would be:

{{ user.firstName }}
{{ user.lastName }}
{{ user.photo }}

I'm 90% sure that user.password isn't exposed to Twig by default (for security reasons), but there are ways around that if you really need to expose the password hash to a template.

Note that first and last names are string, but the photo is an instance of craft\elements\Asset.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.