Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7860349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:15:12+00:00 2026-06-02T22:15:12+00:00

Alright, I’ve got an array that looks like. [0] => Array ( first_name =>

  • 0

Alright, I’ve got an array that looks like.

[0] => Array (
  first_name => j,
  last_name => b,
  times => Array(
    [0] => Array(
        [in1] => a date here
        [out1] => a date here
        [in2] => a date here
        [out2] => a date here
    )
    [1] => Array(
        [in1] => another date here
        [out1] => another date here
        [in2] => another date here
        [out2] => another date here
    ))) 

I’ve simplified the look of the array for the sake of the SO layouts…

This list will often times have over 100 different people in the beginning array which will all need to be output to the browser… Which is fine I can do that..

{% for entity in entity %}
<h3>{{ entity.first_name }} {{ entity.last_name }} ( {{ start|date("m/d/Y") }} - {{ end|date("m/d/Y")}} )</h3>

<table = border="1" cellpadding="5" cellspacing="0">
        <thead>
            <tr>
                <th>Date</th>
                <th>In</th>
                <th>Lunch Out</th>
                <th>Lunch In</th>
                <th>Out</th>
                <th>Extra In</th>
                <th>Extra Out</th>
                <th>Total Time</th>
            </tr>
        </thead>
        <tbody>
            {% for times in entity.times %}
            <tr>
                <td>{{ entity.times.daydate|date("M jS Y") }} </td>
                <td>{{ entity.times.in1 is empty ? "" : entity.times.in1|date("h:i A") }}</td>
                <td>{{ entity.times.out1 is empty ? "" : entity.times.out1|date("h:i A") }}</td>
                <td>{{ entity.times.in2 is empty ? "" : entity.times.in2|date("h:i A") }}</td>
                <td>{{ entity.times.out2 is empty ? "" : entity.times.out2|date("h:i A") }}</td>
                <td>{{ entity.times.in3 is empty ? "" : entity.times.in3|date("h:i A") }}</td>
                <td>{{ entity.times.out3 is empty ? "" : entity.times.out3|date("h:i A") }}</td>
                <td>{{ entity.times.totaltime }} Hours</td>
            </tr>
            {% endfor%}
        </tbody>
</table>
{% endfor %}

That is my current twig code… What I need help with, is since each “entity” has a .times sub-array that also needs to be looped through.. What is the proper way to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:15:14+00:00Added an answer on June 2, 2026 at 10:15 pm
    {% for entity in entities %}
        <h3>{{ entity.foo }}</h3>
    
        {% for time in entity.times %}
            <p>{{ time.bar }}</p>
        {% endfor %}
    {% endfor %}
    

    I’ve simplified the code so that it’s easier to see the concept you are looking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, this is basic c++ here. I've got a class that is a Linear
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
alright, I'm trying something which should be like really easy. Here it is: usort($newarr,
Alright, here we go! I am currently developing an iPhone app that will work
Alright, this one's interesting. I have a solution, but I don't like it. The
Alright, I hope this isn't too broad a question but my curiosity got the
Alright, hard to phrase an exact title for this question, but here goes... I
Alright so this is a bizarre cross platform thing that I'm experiencing with text
Alright y'all. I am attempting to write a bit of code that places typographic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.