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

  • Home
  • SEARCH
  • 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 3271406
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:43:31+00:00 2026-05-17T18:43:31+00:00

I have a multi-dimensional array generated in PHP: array( ‘Requirements’ => array( ‘export_requirements’ =>

  • 0

I have a multi-dimensional array generated in PHP:

array(
            'Requirements' => array(
                'export_requirements' => array('value'=> 1, 'label'=> 'Export'),
                'add_requirements' => array('value'=> 2, 'label'=> 'Add'),
                'add_private_requirements' => array('value'=> 4, 'label'=> 'Add Private Requirements'),
                'log_activity' => array('value'=> 8, 'label'=> 'Log Activity / Schedule Event'),
                'edit_activity' => array('value'=> 16, 'label'=> 'Edit Activity'),
                'delete_activity' => array('value'=> 32, 'label'=> 'Delete Activity'),
                'edit_requirements' => array('value'=> 64, 'label'=> 'Edit Requirements'),
                'edit_requirements_private' => array('value'=> 128, 'label'=> 'Edit Private Requirements'),
            ),
            'Resources' => array(
                'export_resources' => array('value'=> 1, 'label'=> 'Export'),
                'add_resources' => array('value'=> 2, 'label'=> 'Add'),
                'add_private_resources' => array('value'=> 4, 'label'=> 'Add Private Resources'),
                'log_activity' => array('value'=> 8, 'label'=> 'Log Activity / Schedule Event'),
                'edit_activity' => array('value'=> 16, 'label'=> 'Edit Activity'),
                'delete_activity' => array('value'=> 32, 'label'=> 'Delete Activity'),
                'edit_resources' => array('value'=> 64, 'label'=> 'Edit Resources'),
                'edit_resources_private' => array('value'=> 128, 'label'=> 'Edit Private Resources'),
            ),
            'Prospects' => array(
                'export_prospects' => array('value'=> 1, 'label'=> 'Export'),
                'add_prospects' => array('value'=> 2, 'label'=> 'Add'),
                'show_nsa' => array('value'=> 4, 'label'=> 'Show NSA Details'),
                'edit_prospects' => array('value'=> 8, 'label'=> 'Edit'),
                'log_activity' => array('value'=> 16, 'label'=> 'Log Activity / Schedule Event'),
                'edit_activity' => array('value'=> 32, 'label'=> 'Edit Activity'),
                'delete_activity' => array('value'=> 64, 'label'=> 'Delete Activity'),
            ),
            'Contacts' => array(
                'export_contacts' => array('value'=> 1, 'label'=> 'Export'),
                'add_contacts' => array('value'=> 2, 'label'=> 'Add'),
                'edit_contacts' => array('value'=> 4, 'label'=> 'Edit'),
                'log_activity' => array('value'=> 8, 'label'=> 'Log Activity / Schedule Event'),
                'edit_activity' => array('value'=> 16, 'label'=> 'Edit Activity'),
                'delete_activity' => array('value'=> 32, 'label'=> 'Delete Activity'),
            ),
            'Clients' => array(
                'export_clients' => array('value'=> 1, 'label'=> 'Export'),
                'add_clients' => array('value'=> 2, 'label'=> 'Add'),
                'show_caution_note' => array('value'=> 4, 'label'=> 'Show Caution Note'),
                'show_nsa_msa' => array('value'=> 8, 'label'=> 'Show NSA and MSA Details'),
                'edit_dormant_caution_caution_notes' => array('value'=> 16, 'label'=> 'Edit Dormant, Caution, Caution Notes'),
                'log_activity' => array('value'=> 32, 'label'=> 'Log Activity'),
                'edit_activity' => array('value'=> 64, 'label'=> 'Edit Activity'),
                'delete_activity' => array('value'=> 128, 'label'=> 'Delete Activity'),
            ),
            'Reports' => array(
                'view' => array('value'=> 1, 'label'=> 'View'),
            ),
            'Settings' => array(
                'administration' => array('value'=> 1, 'label'=> 'Administration'),
                'view_data_item_history' => array('value'=> 2, 'label'=> 'View Data Item History'),
                'assign_group_permissions' => array('value'=> 4, 'label'=> 'Assign Group Permissions'),
                'manage_users' => array('value'=> 8, 'label'=> 'Manage Users'),
                'assign_user_permissions' => array('value'=> 16, 'label'=> 'Assign User Permission'),
                'manage_roles' => array('value'=> 32, 'label'=> 'Manage Roles'),
                'assign_role_permission' => array('value'=> 64, 'label'=> 'Assign Role Permission'),
            ),
        );

Is there a way to loop through this using Smarty?

I’ve gotten so far:

{foreach from=$all_perms  key=k item=v}
            <table width="100%" border="0" cellspacing="0" cellpadding="0"  class="detail view">
                <tr>
                <th colspan='4' align="left" width="100%" valign="top"><h4><slot>{$k}</slot></h4></th>
                </tr>
                {foreach from=$all_perms  key=k item=v} {% I'm stuck at this for loop %}
                    <tr>
                        <td width="15%" valign="top" scope="row">
                            <slot>{$k}:</slot>
                        </td>
                        <td width="85%" valign="top">
                            <slot>Allow</slot>
                        </td>
                    </tr>
                {/foreach}
            </table>
        {/foreach}
  • 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-05-17T18:43:32+00:00Added an answer on May 17, 2026 at 6:43 pm

    Try changing the second loop:

    {foreach from=$v  key=key item=value}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multidimensional array. I need to search it for a specific range
I have just noticed that a multidimensional array in C# does not implement IEnumerable<T>
I have CSV data loaded into a multidimensional array. In this way each row
how do I make a pointer to a multidimensional array, which have a unknown
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
I have a multi-line string that I want to do an operation on each
I have a multi-table query, similar to this (simplified version) SELECT columns, count(table2.rev_id) As
I have a multi-user ASP.NET app running against SQL Server and want to have
I have a multi-threaded C++ app which does 3D rendering with the OpenSceneGraph library.
I have a multi-timezone web application that stores all of the datetime values in

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.