I am having the below array structure created based on some operations in PHP.
array
(
[7] => array(
[id] => 7
[page] => dashboard
[text] => Text 3
)
[1] => array(
[id] => 1
[page] => index
[text] => Text 2
)
[3] => array(
[id] => 3
[page] => index
[text] => Text 3
)
}
I am using the below Smarty template to create table based on this array structure and it works fine.
<table>
<tr>
<th>{text key='sitetour+page'}</th>
<th>{text key='sitetour+text'}</th>
</tr>
{foreach from=$allSteps key='id' item='step'}
<tr>
<td>{$step.page}</td>
<td>{$step.text}</td>
</tr>
{/foreach}
</table>
What I am looking for is that, based on the value of "page", I need to create tables for each unique value of "page" instead of single table with all values.
Examples are provided below.
Current output: ( single table irrespective of the page value)
page | text
---------------------
dashboard | text 3
index | text 2
index | text 3
Expected Output: ( 2 tables which are broken based on the page value)
dashboard
---------------------
text 3
index
---------------------
text 2
text 3
I could not find any sample when I searched over here. Thanks in advance.