This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

JCFutch
JCFutch

Hello all!

I am a newer user to October and I LOVE it. I have been digging at code and documentation and already had some familiarity with Laravel. My question is how to display users on the front end? I am currently working on a project where the admin users will be able to see a list of users in the system on the front-end. Since I am the actual administrator, I don't want others messing around on the backend of the application, because we all know what happens when too many fingers get put in the mix.

I can display myself (user) using Twig syntax as so: {{ user.(whatever field in the DB) }} This works fine. But I have a table that I want to display all the users in. I looked over Twig's for loop references, and I would imagine that I would need to do something like {% for user in users %} in order to run through all the users. I haven't really messed with Twig before now, so it's still unfamiliar, but loop sequence logic is basically the same in any situation. Foreach loops will iterate over an array. Do I have to capture the table in to an array BEFORE running the Twig for loop? This is what I am currently doing:

{% for user in users %} {{ user.name|e }} {% endfor %}

Thanks in advance!

Last updated

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.